Skip to content

Conversation

@forfudan
Copy link
Owner

This pull request introduces several new features and improvements to the decimojo library, focusing on arithmetic operations, benchmarking, and rounding modes. The most important changes include adding new arithmetic functions, updating benchmarks, and refining the rounding mode implementation.

New Arithmetic Functions:

  • Added floor_divide and modulo functions to the arithmetics.mojo file. These functions provide integral division and remainder operations for Decimal types.

Benchmark Updates:

  • Updated benches/bench.mojo to include new benchmarks for floor_divide and modulo operations.
  • Updated mojoproject.toml to include test and benchmark commands for floor_divide and modulo.

Rounding Mode Improvements:

  • Refined the RoundingMode struct by renaming methods and aliases to use lowercase names, improving code readability and consistency.

Code Simplification:

  • Simplified the Decimal struct by removing unnecessary exception handling in arithmetic dunder methods.
  • Removed redundant scientific exponent calculation method from the Decimal struct.

Miscellaneous:

  • Updated the __init__.mojo file to import the new divide, floor_divide, and modulo functions.
  • Fixed the rounding mode in the Decimal struct to use the correct constant names.

@forfudan forfudan merged commit 96b5a01 into main Mar 21, 2025
1 check passed
@forfudan forfudan deleted the work branch March 21, 2025 22:37
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