From the official Go docs:
Int63n returns, as an int64, a non-negative pseudo-random number in [0,n) from the default Source. It panics if n <= 0.
Why is it called Int63n when it returns a 64 bit integer?
Int63n returns, as an int64, a non-negative pseudo-random number in [0,n) from the default Source
int64 is a 64-bit signed integer type. That means it has 1 sign bit and 63 significant bits. That means that anything returning a non-negative int64 is producing 63 bits of data (the 64th bit, the sign bit, will always have the same value).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With