[integer] Update multiply_inplace_by_uint32() for BigUInt when the y is no greater than 4
#104
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 several enhancements and modifications to the
BigUIntandBigDecimalarithmetic operations. Key changes include the introduction of optimized carry normalization methods, improvements to division algorithms, and the addition of a specialized multiplication function for small values. These changes aim to improve performance, readability, and maintainability of the codebase.Enhancements to Carry Normalization:
normalize_carriestonormalize_carries_lt_2_basesand introducednormalize_carries_lt_4_basesfor handling specific ranges of word values during arithmetic operations. These methods ensure efficient normalization of carries based on the range of input values. [1] [2]Optimizations for Multiplication:
multiply_inplace_by_uint32_le_4to handle multiplication by small integers (0–4) more efficiently using SIMD instructions and specialized carry normalization. This is integrated into the existingmultiply_inplace_by_uint32function. [1] [2]Improvements to Division Algorithms:
normalization_factorwithndigits_to_shiftfor better clarity in division-related functions. Updated the logic for calculating normalization shifts and gap ratios for more accurate and efficient division processes. [1] [2] [3]calculate_normalization_factorfunction tocalculate_number_of_shifted_digits_for_normalizationfor better semantic clarity.Code Simplifications:
floor_divide_inplace_by_2function by removing redundant carry logic and replacing it with a more concise implementation using a boolean flag for carry tracking.Documentation and Naming Improvements:
floor_divide_three_by_twonow refers to "parts" instead of "words").These changes collectively enhance the precision, performance, and maintainability of the arithmetic operations in the
decimojolibrary.