Skip to content

[decimal] Implement some IO methods for BigDecimal#65

Merged
forfudan merged 2 commits intomainfrom
dec
Mar 28, 2025
Merged

[decimal] Implement some IO methods for BigDecimal#65
forfudan merged 2 commits intomainfrom
dec

Conversation

@forfudan
Copy link
Copy Markdown
Owner

This pull request introduces significant changes to the decimojo library, primarily focusing on the addition of the BigDecimal type and various improvements to the BigInt and BigUInt types. The changes include new functionality, refactoring, and code cleanup.

New Features:

  • BigDecimal Implementation:
    • Added a new BigDecimal type with comprehensive methods for construction, arithmetic operations, and type conversion. (src/decimojo/bigdecimal/bigdecimal.mojo)

Refactoring and Code Cleanup:

  • BigInt Enhancements:

    • Refactored BigInt to handle the case of Int.MIN more robustly by introducing an is_min flag. (src/decimojo/bigint/bigint.mojo) [1] [2]
    • Updated method names from to_str to to_string for consistency. (src/decimojo/bigint/bigint.mojo) [1] [2] [3] [4] [5]
    • Removed commented-out initializers to clean up the code. (src/decimojo/bigint/bigint.mojo)
  • BigUInt Enhancements:

    • Added a type alias BUInt for BigUInt to improve code readability. (src/decimojo/biguint/biguint.mojo)
    • Updated method names from to_str to to_string for consistency. (src/decimojo/biguint/biguint.mojo) [1] [2] [3]

Import Adjustments:

  • Import Statements:
    • Updated import statements to include BigDecimal and the new alias BUInt. (src/decimojo/__init__.mojo)

@forfudan forfudan merged commit d91e41a into main Mar 28, 2025
1 check passed
@forfudan forfudan deleted the dec branch March 28, 2025 20:42
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