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 bitSize argument specifies the integer type
// that the result must fit into. Bit sizes 0, 8, 16, 32, and 64
// correspond to int, int8, int16, int32, and int64.
// If bitSize is below 0 or above 64, an error is returned.
func ParseInt(s string, base int, bitSize int) (i int64, err error)
return i int64;
bitSize int if 8/16/32 to int64(int8/16/32) return.
The text was updated successfully, but these errors were encountered:
Hello there @mkgti, thank you for asking this question and welcome to the Go project!
We use an int64 as the return value, which is the maximum of those bit sizes so 0, 8, 16, 32 and 64 can all fit into 64 bits. As the docs guide, if you use 0 as the bitSize, it'll try to fit the bits into int whose value varies across whether you are on 32 bit or 64 bit architectures.
Anyways, we don't use the Go issue tracker to ask question. For asking questions, please see:
// The bitSize argument specifies the integer type
// that the result must fit into. Bit sizes 0, 8, 16, 32, and 64
// correspond to int, int8, int16, int32, and int64.
// If bitSize is below 0 or above 64, an error is returned.
func ParseInt(s string, base int, bitSize int) (i int64, err error)
return i int64;
bitSize int if 8/16/32 to int64(int8/16/32) return.
The text was updated successfully, but these errors were encountered: