You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add bigint (256 bit + sign) initial scaffolding
This PR introduces support to signed 256 bit integers.
Briefly:
- Add code for generic big integer handling (`intn.c`), limited to 256 bit for
the sake of simplicity, but it might be expanded to generic big integers with
some additional work
- Refactored arithmetic BIF helpers
- Refactored `integer_to_binary`/`_to_list` in order to reduce both code
duplication and make it simpler adding big integers support
- Reimplemented `binary_to_integer` in to make it compliant with OTP (binaries
such as `<<"0xCAFE">>` or `<<" 42">>` must be rejected).
- Replaced `lltoa` with more performant functions that do not rely on slow
helpers, specially for base 10 and 16
- Added bigint support to '*' operator
- Boxed integers can be either positive and negative; also added predicates for
checking signed type
- Added support for big literals
- Added support for big integers to `binary_to_term` and `term_to_binary`
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
0 commit comments