Skip to content

[integer] Re-write arithmetic functions of BigInt by using BigUInt's methods#61

Merged
forfudan merged 4 commits intomainfrom
bigint
Mar 26, 2025
Merged

[integer] Re-write arithmetic functions of BigInt by using BigUInt's methods#61
forfudan merged 4 commits intomainfrom
bigint

Conversation

@forfudan
Copy link
Copy Markdown
Owner

This pull request includes several changes to the BigInt and BigUInt structures in the decimojo library. The most important changes involve adding new methods, renaming and refactoring existing methods, and updating internal representation functions.

Enhancements to BigInt:

  • Added __pow__ methods to handle exponentiation with both Self and Int types and the corresponding power methods for internal calculations. [1] [2]
  • Renamed compare_absolute to compare_magnitudes and reintroduced the compare method. [1] [2]
  • Updated the internal_representation method to use self instead of value for printing internal details.

Enhancements to BigUInt:

  • Moved the compare method to a new location within the struct and adjusted the power method to handle large exponents more robustly.
  • Updated the internal_representation method to use self instead of value for printing internal details.

Changes in comparison.mojo:

  • Renamed the compare_absolute function to compare_magnitudes to better reflect its purpose and updated references to it. [1] [2]

@forfudan forfudan changed the title [integer] Re-write arithmetics module of `b [integer] Re-write arithmetic functions of BigInt by using BigUInt's methods Mar 26, 2025
@forfudan forfudan merged commit df8e221 into main Mar 26, 2025
1 check passed
@forfudan forfudan deleted the bigint branch March 26, 2025 22:59
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