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
The solang compiler uses this crate for integer literals, which can 256 bits in Solidity.
However formatting bigints with Display is not great.
contract c {
int256 constant a = 1e1000;
}
gives the diagnostic:
error: literal 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 is too large to fit into type 'int256'
It would be nice if we had a .to_human_readable() function which would either use e notation or what solc does:
Error: Type int_const 1000...(993 digits omitted)...0000 is not implicitly convertible to expected type int256. Literal is too large to fit in int256.
This would work for large numbers which don't consist of lots of zeros too.
The text was updated successfully, but these errors were encountered:
The solang compiler uses this crate for integer literals, which can 256 bits in Solidity.
However formatting bigints with
Display
is not great.gives the diagnostic:
error: literal 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 is too large to fit into type 'int256'
It would be nice if we had a
.to_human_readable()
function which would either use e notation or what solc does:Error: Type int_const 1000...(993 digits omitted)...0000 is not implicitly convertible to expected type int256. Literal is too large to fit in int256.
This would work for large numbers which don't consist of lots of zeros too.
The text was updated successfully, but these errors were encountered: