Skip to content

Commit 8ed3dab

Browse files
authored
[mojo] Update codebase to Mojo v25.4 (#87)
1 parent fd82601 commit 8ed3dab

38 files changed

+335
-227
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ This repository includes [TOMLMojo](https://github.com/forfudan/decimojo/tree/ma
3030
| ------------ | ------- | ------------------------------------ | ----------------------------------- |
3131
| `BigUInt` | `BUInt` | arbitrary-precision unsigned integer | `List[UInt32]` |
3232
| `BigInt` | `BInt` | arbitrary-precision integer | `BigUInt`, `Bool` |
33-
| `Decimal` | `Dec` | 128-bit fixed-precision decimal | `UInt32`,`UInt32`,`UInt32`,`UInt32` |
3433
| `BigDecimal` | `BDec` | arbitrary-precision decimal | `BigUInt`, `Int`, `Bool` |
34+
| `Decimal` | `Dec` | 128-bit fixed-precision decimal | `UInt32`,`UInt32`,`UInt32`,`UInt32` |
3535

3636
## Installation
3737

3838
DeciMojo is available in the [modular-community](https://repo.prefix.dev/modular-community) package repository. You can install it using any of these methods:
3939

4040
From the `pixi` CLI, simply run ```pixi add decimojo```. This fetches the latest version and makes it immediately available for import.
4141

42-
For projects with a `mojoproject.toml`file, add the dependency ```decimojo = ">=0.3.1"```. Then run `pixi install` to download and install the package.
42+
For projects with a `mojoproject.toml`file, add the dependency ```decimojo = "==0.4.0"```. Then run `pixi install` to download and install the package.
4343

4444
For the latest development version, clone the [GitHub repository](https://github.com/forfudan/decimojo) and build the package locally.
4545

@@ -49,6 +49,7 @@ For the latest development version, clone the [GitHub repository](https://github
4949
| v0.2.0 | ==25.2 | magic |
5050
| v0.3.0 | ==25.2 | magic |
5151
| v0.3.1 | >=25.2, <25.4 | pixi |
52+
| v0.4.0 | ==25.4 | pixi |
5253

5354
## Quick start
5455

@@ -217,7 +218,7 @@ If you find DeciMojo useful for your research, consider listing it in your citat
217218
year = {2025},
218219
title = {An arbitrary-precision decimal and integer mathematics library for Mojo},
219220
url = {https://github.com/forfudan/decimojo},
220-
version = {0.3.1},
221+
version = {0.4.0},
221222
note = {Computer Software}
222223
}
223224
```

benches/bigdecimal/bench_bigdecimal_add.mojo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ fn open_log_file() raises -> PythonObject:
2828

2929
# Generate a timestamp for the filename
3030
var timestamp = String(datetime.datetime.now().isoformat())
31-
var log_filename = log_dir + "/benchmark_bigdecimal_add_" + timestamp + ".log"
31+
var log_filename = (
32+
log_dir + "/benchmark_bigdecimal_add_" + timestamp + ".log"
33+
)
3234

3335
print("Saving benchmark results to:", log_filename)
3436
return python.open(log_filename, "w")

benches/bigdecimal/bench_bigdecimal_divide.mojo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ fn open_log_file() raises -> PythonObject:
2828

2929
# Generate a timestamp for the filename
3030
var timestamp = String(datetime.datetime.now().isoformat())
31-
var log_filename = log_dir + "/benchmark_bigdecimal_divide_" + timestamp + ".log"
31+
var log_filename = (
32+
log_dir + "/benchmark_bigdecimal_divide_" + timestamp + ".log"
33+
)
3234

3335
print("Saving benchmark results to:", log_filename)
3436
return python.open(log_filename, "w")

benches/bigdecimal/bench_bigdecimal_exp.mojo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ fn open_log_file() raises -> PythonObject:
2828

2929
# Generate a timestamp for the filename
3030
var timestamp = String(datetime.datetime.now().isoformat())
31-
var log_filename = log_dir + "/benchmark_bigdecimal_exp_" + timestamp + ".log"
31+
var log_filename = (
32+
log_dir + "/benchmark_bigdecimal_exp_" + timestamp + ".log"
33+
)
3234

3335
print("Saving benchmark results to:", log_filename)
3436
return python.open(log_filename, "w")

benches/bigdecimal/bench_bigdecimal_ln.mojo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ fn open_log_file() raises -> PythonObject:
2828

2929
# Generate a timestamp for the filename
3030
var timestamp = String(datetime.datetime.now().isoformat())
31-
var log_filename = log_dir + "/benchmark_bigdecimal_ln_" + timestamp + ".log"
31+
var log_filename = (
32+
log_dir + "/benchmark_bigdecimal_ln_" + timestamp + ".log"
33+
)
3234

3335
print("Saving benchmark results to:", log_filename)
3436
return python.open(log_filename, "w")

benches/bigdecimal/bench_bigdecimal_multiply.mojo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ fn open_log_file() raises -> PythonObject:
2828

2929
# Generate a timestamp for the filename
3030
var timestamp = String(datetime.datetime.now().isoformat())
31-
var log_filename = log_dir + "/benchmark_bigdecimal_multiply_" + timestamp + ".log"
31+
var log_filename = (
32+
log_dir + "/benchmark_bigdecimal_multiply_" + timestamp + ".log"
33+
)
3234

3335
print("Saving benchmark results to:", log_filename)
3436
return python.open(log_filename, "w")

benches/bigdecimal/bench_bigdecimal_root.mojo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ fn open_log_file() raises -> PythonObject:
2828

2929
# Generate a timestamp for the filename
3030
var timestamp = String(datetime.datetime.now().isoformat())
31-
var log_filename = log_dir + "/benchmark_bigdecimal_root_" + timestamp + ".log"
31+
var log_filename = (
32+
log_dir + "/benchmark_bigdecimal_root_" + timestamp + ".log"
33+
)
3234

3335
print("Saving benchmark results to:", log_filename)
3436
return python.open(log_filename, "w")

benches/bigdecimal/bench_bigdecimal_round.mojo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ fn open_log_file() raises -> PythonObject:
2828

2929
# Generate a timestamp for the filename
3030
var timestamp = String(datetime.datetime.now().isoformat())
31-
var log_filename = log_dir + "/benchmark_bigdecimal_round_" + timestamp + ".log"
31+
var log_filename = (
32+
log_dir + "/benchmark_bigdecimal_round_" + timestamp + ".log"
33+
)
3234

3335
print("Saving benchmark results to:", log_filename)
3436
return python.open(log_filename, "w")

benches/bigdecimal/bench_bigdecimal_scale_up_by_power_of_10.mojo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ fn open_log_file() raises -> PythonObject:
2626

2727
# Generate a timestamp for the filename
2828
var timestamp = String(datetime.datetime.now().isoformat())
29-
var log_filename = log_dir + "/benchmark_biguint_scale_up_" + timestamp + ".log"
29+
var log_filename = (
30+
log_dir + "/benchmark_biguint_scale_up_" + timestamp + ".log"
31+
)
3032

3133
print("Saving benchmark results to:", log_filename)
3234
return python.open(log_filename, "w")

benches/bigdecimal/bench_bigdecimal_sqrt.mojo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ fn open_log_file() raises -> PythonObject:
2828

2929
# Generate a timestamp for the filename
3030
var timestamp = String(datetime.datetime.now().isoformat())
31-
var log_filename = log_dir + "/benchmark_bigdecimal_sqrt_" + timestamp + ".log"
31+
var log_filename = (
32+
log_dir + "/benchmark_bigdecimal_sqrt_" + timestamp + ".log"
33+
)
3234

3335
print("Saving benchmark results to:", log_filename)
3436
return python.open(log_filename, "w")

0 commit comments

Comments
 (0)