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
A complete integer bignum implementation, with arbitrary integers, might take quite some flash space, so we may rather investigate support for "bigger integers".
Right now our biggest supported integer type is signed int64, that means we support up to UINT63_MAX, leaving out bigger positive integers such as values that can be represented with an uint64.
Rationale: uint64 is quite widespread in some serialization formats, such as protobuf and others, so it might tricky to handle that kind of values.
On the BEAM boxed integers already have a bit available for sign (001s BIGNUM with sign bit):
should we use it for extending support up to 64 + sign bit?
supporting wider integers such as 128 bit or 256 bit integers seems a reasonable amount of work. Should we support them (and keep one of them as new limit)?
what is a reasonable limit for wider integers? (e.g. 512 bit integers seems quite uncommon)
should we rather support uint64 as a wider signed integer?
also, let's assume we are going to support a 256 bit integer, should we keep the sign bit out of it?
Also it is worth to be noted we don't need to support multiple bigger integer types, such as both 128 and 256 bit, we can just promote any >= 65 bit to the biggest one (such as the 256 bit integer).
This might be a good feature for v0.7.
The text was updated successfully, but these errors were encountered:
If we can easily extend support to 64-bit signed, that seems like a nice addition. Perhaps some testing on various supported hardware could help determine the largest BIGNUM to support. 512 does seem a bit much for microcontrollers.
Personally I think it would be better to support signed BIGNUM over size. If it comes down to 256 unsigned or 128 signed, I would opt for 128-bit signed.
A complete integer bignum implementation, with arbitrary integers, might take quite some flash space, so we may rather investigate support for "bigger integers".
Right now our biggest supported integer type is signed int64, that means we support up to UINT63_MAX, leaving out bigger positive integers such as values that can be represented with an uint64.
Rationale: uint64 is quite widespread in some serialization formats, such as protobuf and others, so it might tricky to handle that kind of values.
On the BEAM boxed integers already have a bit available for sign (
001s BIGNUM with sign bit
):Also it is worth to be noted we don't need to support multiple bigger integer types, such as both 128 and 256 bit, we can just promote any >= 65 bit to the biggest one (such as the 256 bit integer).
This might be a good feature for v0.7.
The text was updated successfully, but these errors were encountered: