diff --git a/README.md b/README.md index 6a16835..91269b1 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ DeciMojo is available in the [modular-community](https://repo.prefix.dev/modular 1. In the `mojoproject.toml` file of your project, add the following dependency: ```toml - decimojo = "==0.5.0" + decimojo = "==0.6.0" ``` Then run `pixi install` to download and install the package. @@ -59,6 +59,7 @@ The following table summarizes the package versions and their corresponding Mojo | v0.3.1 | >=25.2, <25.4 | pixi | | v0.4.x | ==25.4 | pixi | | v0.5.0 | ==25.5 | pixi | +| v0.6.0 | ==0.25.7 | pixi | ## Quick start @@ -304,7 +305,7 @@ If you find DeciMojo useful for your research, consider listing it in your citat year = {2025}, title = {An arbitrary-precision decimal and integer mathematics library for Mojo}, url = {https://github.com/forfudan/decimojo}, - version = {0.5.0}, + version = {0.6.0}, note = {Computer Software} } ``` diff --git a/benches/bigdecimal/bench_bigdecimal_round.mojo b/benches/bigdecimal/bench_bigdecimal_round.mojo index b73a53c..9550778 100644 --- a/benches/bigdecimal/bench_bigdecimal_round.mojo +++ b/benches/bigdecimal/bench_bigdecimal_round.mojo @@ -110,7 +110,7 @@ fn run_benchmark_round( var t0 = perf_counter_ns() for _ in range(iterations): _ = mojo_value.round(decimal_places, rounding_mode_mojo) - var mojo_time = (perf_counter_ns() - t0) / iterations + var mojo_time = (perf_counter_ns() - t0) / UInt(iterations) if mojo_time == 0: mojo_time = 1 # Prevent division by zero @@ -118,7 +118,7 @@ fn run_benchmark_round( t0 = perf_counter_ns() for _ in range(iterations): _ = py_value.__round__(decimal_places) - var python_time = (perf_counter_ns() - t0) / iterations + var python_time = (perf_counter_ns() - t0) / UInt(iterations) # Calculate speedup factor var speedup = python_time / mojo_time @@ -194,7 +194,7 @@ fn main() raises: "Round down to integer", "12.345", 0, - RoundingMode.ROUND_DOWN, + materialize[RoundingMode.ROUND_DOWN](), "ROUND_DOWN", iterations, log_file, @@ -206,7 +206,7 @@ fn main() raises: "Round down to 1 decimal place", "12.345", 1, - RoundingMode.ROUND_DOWN, + materialize[RoundingMode.ROUND_DOWN](), "ROUND_DOWN", iterations, log_file, @@ -218,7 +218,7 @@ fn main() raises: "Round down negative to integer", "-12.345", 0, - RoundingMode.ROUND_DOWN, + materialize[RoundingMode.ROUND_DOWN](), "ROUND_DOWN", iterations, log_file, @@ -232,7 +232,7 @@ fn main() raises: "Round up to integer", "12.345", 0, - RoundingMode.ROUND_UP, + materialize[RoundingMode.ROUND_UP](), "ROUND_UP", iterations, log_file, @@ -244,7 +244,7 @@ fn main() raises: "Round up to 1 decimal place", "12.345", 1, - RoundingMode.ROUND_UP, + materialize[RoundingMode.ROUND_UP](), "ROUND_UP", iterations, log_file, @@ -256,7 +256,7 @@ fn main() raises: "Round up negative to integer", "-12.345", 0, - RoundingMode.ROUND_UP, + materialize[RoundingMode.ROUND_UP](), "ROUND_UP", iterations, log_file, @@ -270,7 +270,7 @@ fn main() raises: "Round half up to integer (0.5 -> 1)", "12.5", 0, - RoundingMode.ROUND_HALF_UP, + materialize[RoundingMode.ROUND_HALF_UP](), "ROUND_HALF_UP", iterations, log_file, @@ -282,7 +282,7 @@ fn main() raises: "Round half up to 1 decimal place (0.05 -> 0.1)", "12.05", 1, - RoundingMode.ROUND_HALF_UP, + materialize[RoundingMode.ROUND_HALF_UP](), "ROUND_HALF_UP", iterations, log_file, @@ -294,7 +294,7 @@ fn main() raises: "Round half up negative to integer (-0.5 -> -1)", "-12.5", 0, - RoundingMode.ROUND_HALF_UP, + materialize[RoundingMode.ROUND_HALF_UP](), "ROUND_HALF_UP", iterations, log_file, @@ -308,7 +308,7 @@ fn main() raises: "Round half even to integer (even digit)", "12.5", 0, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -320,7 +320,7 @@ fn main() raises: "Round half even to integer (odd digit)", "13.5", 0, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -332,7 +332,7 @@ fn main() raises: "Round half even to 1 decimal place (even digit)", "12.25", 1, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -346,7 +346,7 @@ fn main() raises: "Round to higher precision (add zeros)", "12.345", 5, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -358,7 +358,7 @@ fn main() raises: "Negative decimal places (round to tens)", "123.456", -1, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -370,7 +370,7 @@ fn main() raises: "Negative decimal places (round to hundreds)", "123.456", -2, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -384,7 +384,7 @@ fn main() raises: "Round zero", "0", 2, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -396,7 +396,7 @@ fn main() raises: "Round very small number", "0.0000000000000000000000001", 10, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -408,7 +408,7 @@ fn main() raises: "Round very large number", "9999999999.99999", 2, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -420,7 +420,7 @@ fn main() raises: "Round with carry over (9.9999 -> 10)", "9.9999", 0, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -432,7 +432,7 @@ fn main() raises: "Round exactly half (down)", "10.5", 0, - RoundingMode.ROUND_DOWN, + materialize[RoundingMode.ROUND_DOWN](), "ROUND_DOWN", iterations, log_file, @@ -443,7 +443,7 @@ fn main() raises: "Round exactly half (up)", "10.5", 0, - RoundingMode.ROUND_UP, + materialize[RoundingMode.ROUND_UP](), "ROUND_UP", iterations, log_file, @@ -454,7 +454,7 @@ fn main() raises: "Round exactly half (half up)", "10.5", 0, - RoundingMode.ROUND_HALF_UP, + materialize[RoundingMode.ROUND_HALF_UP](), "ROUND_HALF_UP", iterations, log_file, @@ -465,7 +465,7 @@ fn main() raises: "Round exactly half (half even)", "10.5", 0, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -479,7 +479,7 @@ fn main() raises: "Round scientific notation value", "1.2345e5", 2, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, @@ -491,7 +491,7 @@ fn main() raises: "Round small scientific notation value", "1.2345e-5", 8, - RoundingMode.ROUND_HALF_EVEN, + materialize[RoundingMode.ROUND_HALF_EVEN](), "ROUND_HALF_EVEN", iterations, log_file, diff --git a/docs/changelog.md b/docs/changelog.md index 393ca5d..eec23fd 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,10 @@ This is a list of RELEASED changes for the DeciMojo Package. +## 20251216 (v0.6.0) + +DeciMojo v0.6.0 updates the codebase to Mojo v25.7, adopting the new `TestSuite` type for improved test organization. All tests have been refactored to use the native Mojo testing framework instead of the deprecated `pixi test` command. + ## 20250806 (v0.5.0) DeciMojo v0.5.0 introduces significant enhancements to the `BigDecimal` and `BigUInt` types, including new mathematical functions and performance optimizations. The release adds **trigonometric functions** for `BigDecimal`, implements the **Chudnovsky algorithm** for computing π, and implements the **Karatsuba multiplication algorithm** and **Burnikel-Ziegler division algorithm** for `BigUInt`. In-place operations, slice operations, and SIMD operations are now supported for `BigUInt` arithmetic. The `Decimal` type is renamed to `Decimal128` to reflect its 128-bit fixed precision. The release also includes improved error handling, optimized type conversions, refactored testing suites, and documentation updates. diff --git a/docs/readme_zht.md b/docs/readme_zht.md index 29eea33..cc59995 100644 --- a/docs/readme_zht.md +++ b/docs/readme_zht.md @@ -42,7 +42,7 @@ DeciMojo 可在 [modular-community](https://repo.prefix.dev/modular-community) 1. 在您項目的 `mojoproject.toml` 文件中,添加以下依賴: ```toml - decimojo = "==0.5.0" + decimojo = "==0.6.0" ``` 然後運行 `pixi install` 來下載並安裝包。 @@ -59,6 +59,7 @@ DeciMojo 可在 [modular-community](https://repo.prefix.dev/modular-community) | v0.3.1 | >=25.2, <25.4 | pixi | | v0.4.x | ==25.4 | pixi | | v0.5.0 | ==25.5 | pixi | +| v0.6.0 | ==0.25.7 | pixi | ## 快速開始 @@ -306,7 +307,7 @@ DeciMojo 結合了 "Deci" 和 "Mojo" 兩詞,反映了其目的和實現語言 year = {2025}, title = {An arbitrary-precision decimal and integer mathematics library for Mojo}, url = {https://github.com/forfudan/decimojo}, - version = {0.5.0}, + version = {0.6.0}, note = {Computer Software} } ```