[decimal] Re-implement the true_divide() function for BigDecimal
#110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces enhancements to the BigDecimal division functionality, including refactoring of the
true_dividefunction and the implementation of two new division methods:true_divide_fastandtrue_divide_general. These changes aim to improve precision, performance, and code maintainability.Division Function Refactoring:
true_dividefunction to simplify logic and delegate division tasks to specialized helper functions (true_divide_fastandtrue_divide_general). This improves readability and separates concerns.New Division Methods:
true_divide_fast: Introduced a high-performance division method that avoids rounding and trailing zero removal, suitable for cases where speed is prioritized over formatting.true_divide_general: Added a precise division method that rounds results to the specified precision and removes unnecessary trailing zeros, ensuring compliance with exact division requirements.Code Simplification:
timeandtesting) withmathinarithmetics.mojo, aligning dependencies with the updated implementation.Benchmark Enhancements:
ITERATIONS_LARGE_NUMBERSconstant for iterations.