Skip to content

Conversation

@forfudan
Copy link
Owner

This pull request includes significant changes to the decimojo package, primarily focusing on reorganizing and enhancing the comparison operations for the Decimal type. The changes include adding a new comparison module, updating the Decimal struct to use this module, and modifying related benchmarks and tests.

Key Changes:

Comparison Operations:

  • Introduced a new comparison module implementing comparison operations for the Decimal type, including functions like compare, greater, less, greater_equal, less_equal, equal, and not_equal (src/decimojo/comparison.mojo).
  • Updated the Decimal struct to use the new comparison module for comparison operations, replacing previous logic-based comparisons (src/decimojo/decimal.mojo).

Code Reorganization:

  • Moved comparison functions from the logic module to the new comparison module and updated import statements accordingly (src/decimojo/__init__.mojo, src/decimojo/decimal.mojo, src/decimojo/maths/__init__.mojo).

Benchmarks and Tests:

  • Added new benchmarks for from_string and comparison to the benches/bench.mojo file and updated the main function to include these benchmarks (benches/bench.mojo).
  • Updated the mojoproject.toml file to include new test and benchmark commands for comparison (mojoproject.toml).

@forfudan forfudan merged commit 9237fe7 into main Mar 13, 2025
2 checks passed
@forfudan forfudan deleted the compare branch March 13, 2025 20:49
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