-
Notifications
You must be signed in to change notification settings - Fork 130
Doc and improve bigint term funcs #1933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bettio
merged 5 commits into
atomvm:feature/bigint
from
bettio:doc-and-improve-bigint-term-funcs
Oct 28, 2025
Merged
Doc and improve bigint term funcs #1933
bettio
merged 5 commits into
atomvm:feature/bigint
from
bettio:doc-and-improve-bigint-term-funcs
Oct 28, 2025
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
Merged
This function name is going to be used from term.h. Also since it is a static helper, put verb first. Signed-off-by: Davide Bettio <davide@uninstall.it>
Replace duplicated code with new functions in term.h. Signed-off-by: Davide Bettio <davide@uninstall.it>
Use `term_initialize_bigint` instead of `term_intn_data` + `intn_copy` Signed-off-by: Davide Bettio <davide@uninstall.it>
`term_create_uninitialized_intn` -> `term_create_uninitialized_bigint` `term_intn_to_term_size` -> `term_bigint_size_requirements` Also add doxygen documentation. Signed-off-by: Davide Bettio <davide@uninstall.it>
Rename it to BOXED_BIGINT_HEAP_SIZE, and clarify that it must be always used, in order to have the suitable size for allocating space for the bigint term with its boxed header. Signed-off-by: Davide Bettio <davide@uninstall.it>
c06ba96 to
10ce113
Compare
This was referenced Oct 28, 2025
pguyot
approved these changes
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally convinced by term_to_bigint and conv_term_to_bigint function names, but I'll get used to it. conv_term_to_bigint is not meant to be used, but term_to_bigint can be a little bit misleading. But the documentation is clear.
bettio
added a commit
that referenced
this pull request
Oct 29, 2025
bif.c bigint cleanup Move functions & rename variables (to understandable names). Continuation of #1933 These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
bettio
added a commit
that referenced
this pull request
Oct 31, 2025
Fix static_assert in header Continuation of #1933 These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
bettio
added a commit
that referenced
this pull request
Nov 1, 2025
Minimal bigint pattern matching Add everything needed to allow JIT compiler (with big integers support) to run on AtomVM. Continuation of #1933 These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
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.
Add more bigint related functions to
term.h, in order to avoid code duplication.Also document existing ones, and use consistently the
bigintword.The codebase uses two related but distinct terms:
This separation allows the bigint term interface to remain stable even if the underlying multi-precision implementation changes. Functions in term.h use "bigint" because they work with terms, while intn.h contains the actual arithmetic implementation.
Continuation of #1930
These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).
SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later