Skip to content

Conversation

@forfudan
Copy link
Owner

This pull request introduces a new benchmark for scaling up BigUInt values by powers of 10 and includes various improvements and additions to the BigDecimal class. The most important changes include adding a new benchmark file, updating the main benchmark script to include the new benchmark, and enhancing the BigDecimal class with new methods.

New Benchmark:

  • Added bench_bigdecimal_scale_up_by_power_of_10.mojo to benchmark the scale_up_by_power_of_10 function for BigUInt values.

Updates to Benchmark Script:

  • Updated benches/bigdecimal/bench.mojo to include the new benchmark for scaling up by powers of 10. [1] [2] [3]

Enhancements to BigDecimal Class:

  • Added new alias BigDec for BigDecimal in src/decimojo/bigdecimal/bigdecimal.mojo.
  • Introduced augmented arithmetic assignment methods (__iadd__, __isub__, __imul__, __itruediv__) and comparison methods (__gt__, __ge__, __lt__, __le__, __eq__, __ne__) to the BigDecimal class.
  • Added new methods for comparison and mathematical operations (compare, compare_absolute, max, min) to the BigDecimal class.

Other Changes:

  • Updated import statements in src/decimojo/__init__.mojo to include new aliases for BigDecimal and RoundingMode.

@forfudan forfudan changed the title [decimal] Implement comparison operators for BigDecimal [decimal][integer] Implement comparison operators for BigDecimal + Improve BigUInt.scale_up_by_power_of_10() Mar 31, 2025
@forfudan forfudan merged commit a451ca0 into main Mar 31, 2025
1 check passed
@forfudan forfudan deleted the work branch March 31, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants