9 Replies
Thinker
REPL Result: Success
Result: long
Compile: 364.501ms | Execution: 51.173ms | React with ❌ to remove this embed.
Integers aren't infinitely big, at some point the number will overflow
try wrapping that whole method in a
checked
blockOr if you really want practically infinite range then you could use
BigInteger
instead of long
.That's sufficiently big enough yeah?
I'll try that thanks
BigInteger
can for all intents and purposes represent all integers.So it actually has no limits? Does it grow in memory as it increases like a list or something?
Seems to be a byte array, pretty cool
Yep, so the biggest value that a
BigInteger
can represent is the maximum length of an array times the size in bits of a uint
, which is 2^8589934364 - 1
.Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.