Skip to content

Conversation

@forfudan
Copy link
Owner

This pull request includes significant refactoring and improvements to the Decimal struct in the decimojo library. The main changes involve simplifying the initialization of Decimal objects and adding a new method for creating Decimal instances from UInt128 values.

Initialization Refactoring:

  • Simplified the initialization logic by removing redundant constructors and consolidating the initialization process for Int and UInt128 values.

New Method for UInt128 Initialization:

  • Added a new static method from_uint128 to initialize a Decimal from a UInt128 value, including validation for the value and scale.

Code Simplification:

  • Updated existing methods to use the new from_uint128 method for creating Decimal instances from UInt128 values.
  • Modified the sqrt function to use the new from_uint128 method.
  • Updated the round function to use the new from_uint128 method.

@forfudan forfudan merged commit 07ed6bb into main Mar 13, 2025
2 checks passed
@forfudan forfudan deleted the init branch March 13, 2025 22:27
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