Hi guys! I noticed the following. I am working with 18 decimals so I sometimes need to define numbers like:
managed_biguint!(1_000_000_000_000_000_000)
This works as expected. However, if I use one more zero:
managed_biguint!(10_000_000_000_000_000_000)
it yields the incorrect number... even though 10_000_000_000_000_000_000 fits in an u64. For example, in this case it yields 7538dcfb76180000 which translates to 8446744073709551616
The error starts between 9_000_000_000_000_000_000 to 9_300_000_000_000_000_000. Any ideas?
Behind the scenes `BigUint`s are actually `BigInt`s with restrictions. This means it will go through an i64 in the process, even if you declare it as u64.
Just do `managed_biguint!(1_000_000_000_000_000_000) * 10` or something of the sort
to be honest the managed biguint macro is new to me, but I'm assuming it uses a signed 64 bit number, that would explain the range
Behind the scenes `BigUint`s are actually `BigInt`s with restrictions. This means it will go through an i64 in the process, even if you declare it as u64. Just do `managed_biguint!(1_000_000_000_000_000_000) * 10` or something of the sort