4 ms·
Are Go's integers unbounded? If not, proving the value never exceeds the range to silent convert essentially a BigInteger into an int might be hard.
by wolf550e 10y ago
Are Go's integers unbounded? If not, proving the value never exceeds the range to silent convert essentially a BigInteger into an int might be hard.
- jerf 10y agoGo tends to use machine sizes like C, but this implementation appears to properly handle it. The following Python code has identical output for me under Python and grumpy: two_32 = 4294967296 print(two_32 * two_32) print(type(two_32 * two_32)) And I tested some other things I won't burden HN with, but promotion is implemented, yes.