9 ms·
Integer types in current versions of Ruby and Python both have arbitrary precision (as is also true for lots of other languages these days). That's not enough
by rst 5y ago
Integer types in current versions of Ruby and Python both have arbitrary precision (as is also true for lots of other languages these days). That's not enough to make either intrinsically bug-free...
- ithkuil 5y agopython 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.