Skip to content

[integer] Refine the BigUInt division operation#55

Merged
forfudan merged 5 commits intomainfrom
work
Mar 25, 2025
Merged

[integer] Refine the BigUInt division operation#55
forfudan merged 5 commits intomainfrom
work

Conversation

@forfudan
Copy link
Copy Markdown
Owner

This pull request includes several changes to the README.md file and updates to the bench_biguint_truncate_divide.mojo and arithmetics.mojo files to improve documentation, update benchmarks, and refine arithmetic operations.

Code improvement:

  • Improved the algorithm in divide operation of BigUInt, making it correct for cases against Python's Int and making it faster than Python's Int for numbers up to 1000 digits. For numbers with more than 1000 digits, the limit performance will be around x0.25 compared to Python.

Codebase Simplification:

  • Renamed truncate_divide function to floor_divide in arithmetics.mojo to better reflect its operation.
  • Added comments and organized arithmetic operations in arithmetics.mojo for better readability.
  • Improved handling of division operations for small word lengths in arithmetics.mojo.

Documentation Updates:

  • Enhanced the library description to include integer mathematics alongside decimal mathematics in README.md.
  • Updated references to BigInt and BigDecimal for clarity and precision in README.md.

Benchmark Enhancements:

  • Added new benchmark cases for division of large numbers in bench_biguint_truncate_divide.mojo.
  • Simplified division operation in benchmarks by replacing truncate_divide with // operator in bench_biguint_truncate_divide.mojo.

@forfudan forfudan merged commit 38707b4 into main Mar 25, 2025
1 check passed
@forfudan forfudan deleted the work branch March 25, 2025 16:20
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.

1 participant