3 ms·
python does have bignum integer, but there are subtle things, like if you divide an integer with an integer you get a float, where you do lose precision: >>>(1
by ithkuil 5y ago
python does have bignum integer, but there are subtle things, like if you divide an integer with an integer you get a float, where you do lose precision:
>>>(100000000000000000000000000000000000000000000000000/2+1) % 2 == 0
True
if you want to get an integer you have to use the relatively recent "//" operator:
>>> (100000000000000000000000000000000000000000000000000//2+1) % 2 == 1
True
in smalltalk you'd get a Rational or something like that.