Skip to content

Conversation

@forfudan
Copy link
Owner

This pull request includes several changes to enhance the BigDecimal and BigInt functionalities, improve the arithmetic operations, and update the documentation. The main changes include the addition of the multiply function for BigDecimal, improvements to the add and subtract functions, and updates to the string representation methods.

Enhancements to BigDecimal:

  • Added the multiply function to perform multiplication of BigDecimal numbers. [1] [2]
  • Improved the add and subtract functions to handle zero operands more efficiently and ensure precise results. [1] [2] [3] [4]
  • Added the extend_precision method to increase the precision of BigDecimal numbers by adding trailing zeros.
  • Updated the to_string method to support line width limits for better readability. [1] [2]
  • Added the internal_representation method to print the internal representation details of BigDecimal numbers.

Enhancements to BigInt:

  • Updated the to_string method to support line width limits for better readability. [1] [2]
  • Removed unnecessary constants MAX_OF_WORD and BASE_OF_WORD and replaced their usage with direct values. [1] [2]

Documentation updates:

  • Updated the README.md to reflect the current state of the BigDecimal implementation and added a table summarizing the core types and their internal representations.

Benchmark updates:

  • Added the bench_bigdecimal_multiply benchmark to the benches/bigdecimal/bench.mojo file to include multiplication benchmarks. [1] [2] [3]

@forfudan forfudan merged commit e5cc073 into main Mar 29, 2025
1 check passed
@forfudan forfudan deleted the mul branch March 29, 2025 19:36
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