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
Currently the limit is set at maximum 80 digits, that means the largest number representable would be 0.999999999999999999999999999999999999999999999999999999999999999999999999999999999 in the ufixed256x80 type, while the largest number fitting 256 bits is 115792089237316195423570985008687907853269984665640564039457584007913129639936.
999999999999999999999999999999999999999999999999999999999999999999999999999999999
is larger than 115792089237316195423570985008687907853269984665640564039457584007913129639936
It actually requires 266 bits (log2(pow(10, 80) - 1)). I think the proper limit is 77 digits.
Not to mention signed fixed point, where an extra bit must be reserved for the sign.
The text was updated successfully, but these errors were encountered:
Raised in the course of #3389 while discussing conversions.
Possible issue: this could overflow a u256 of 10^(abs(from - to)), causing issues with conversions.
Concerns raised in Gitter:
Consider making it 76 instead instead of (possibly confusing) change based on signed or unsigned.
Consider making max number of decimal places lower based on number of bits such that 1 is always in range.
Currently the limit is set at maximum 80 digits, that means the largest number representable would be
0.999999999999999999999999999999999999999999999999999999999999999999999999999999999
in theufixed256x80
type, while the largest number fitting 256 bits is115792089237316195423570985008687907853269984665640564039457584007913129639936
.999999999999999999999999999999999999999999999999999999999999999999999999999999999
is larger than
115792089237316195423570985008687907853269984665640564039457584007913129639936
It actually requires 266 bits (
log2(pow(10, 80) - 1)
). I think the proper limit is 77 digits.Not to mention signed fixed point, where an extra bit must be reserved for the sign.
The text was updated successfully, but these errors were encountered: