Skip to content

Conversation

@forfudan
Copy link
Owner

@forfudan forfudan commented Jul 5, 2025

This pull request introduces enhancements multiplication of BigUInt by implementing the Karatsuba algorithm.

New BigUInt Functionality:

  • Implement Karatsuba algorithm for multiplication.
  • Implement slices addition and multiplication.
  • src/decimojo/biguint/biguint.mojo: Added a new method scale_up_by_power_of_billion to efficiently scale a BigUInt in-place by powers of a billion, enabling faster operations for specific use cases.
  • Removed the raises keyword from the __iadd__ method as it no longer throws exceptions.

Benchmarking Enhancements:

Configuration and Documentation Updates:

  • pixi.toml: Added a new doc command to generate documentation with validation and diagnostics, improving project maintainability.

Miscellaneous Improvements:

  • benches/biguint/bench_biguint_multiply.mojo: Configured Python's sys module to handle extremely large integers by setting int_max_str_digits to 100,000.
  • Fix a bug for BigUInt comparison where there are leading zero words.

@forfudan forfudan merged commit 8abc559 into main Jul 5, 2025
1 check passed
@forfudan forfudan deleted the mul branch July 5, 2025 01:18
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