Skip to content

Conversation

@forfudan
Copy link
Owner

@forfudan forfudan commented Apr 4, 2025

This pull request introduces a new root function for the BigDecimal library and makes several updates to the benchmarking and testing code to support this new functionality. Additionally, some improvements and optimizations have been made to existing functions.

Key changes include:

New Functionality:

  • Added a new root function to the BigDecimal struct for calculating the nth root of a BigDecimal number.
  • Introduced integer_root and is_integer_reciprocal_and_return helper functions in exponential.mojo to support the new root calculation.

Benchmarking Updates:

  • Updated benches/bigdecimal/bench.mojo to include the new root benchmark, adding the necessary imports, command handling, and execution logic. [1] [2] [3] [4]

Precision Handling:

  • Modified the sqrt function calls in bench_bigdecimal_sqrt.mojo and test_bigdecimal_exponential.mojo to include a precision parameter for consistency and accuracy. [1] [2] [3] [4]

Utility Enhancements:

  • Added an is_one function to the BigDecimal struct to check if a number represents one.

These changes enhance the functionality and precision of the BigDecimal library, particularly with the addition of the new root calculation capabilities.

@forfudan forfudan merged commit 78a05ef into main Apr 4, 2025
1 check passed
@forfudan forfudan deleted the root branch April 4, 2025 21:00
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