Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 includes several changes to the
DeciMojolibrary, focusing on improving theBigUInttype and its arithmetic operations. The most important changes involve refactoring methods for better performance and clarity, and updating documentation.Documentation Updates:
README.md: Updated the description ofBigIntto specify that it is a base-10 arbitrary-precision integer type. Added a detailed explanation of the nomenclature and the design philosophy behindDeciMojo. [1] [2]Code Refactoring:
src/decimojo/biguint/arithmetics.mojo: Replaced manual trailing zero removal with a newremove_trailing_zerosmethod in several functions (subtract,multiply,floor_divide,general_divide). [1] [2] [3] [4]src/decimojo/biguint/arithmetics.mojo: Simplified themultiplyfunction by directly returningBigUInt(UInt32(0))for zero operands.src/decimojo/biguint/arithmetics.mojo: Refactoredfloor_divideto handle single-word divisor cases more efficiently and renamedgeneral_dividetofloor_divide_general. [1] [2] [3] [4] [5] [6]New Methods:
src/decimojo/biguint/arithmetics.mojo: Addedfloor_divide_inplace_by_2to perform in-place division by 2 forBigUInt.Constructor and Initialization Changes:
src/decimojo/biguint/biguint.mojo: UpdatedBigUIntconstructors to differentiate between raw and validated word initialization. Introducedfrom_wordsfor validated initialization and updated the documentation accordingly. [1] [2] [3] [4] [5]Additional Enhancements:
src/decimojo/biguint/biguint.mojo: Added new utility methods__rshift__for right shift operation andis_twoto check if the value is two. [1] [2]benches/biguint/bench.mojo: Includedbench_biguint_addin the benchmark suite.