Re:Beads: Computer language and toolchain
by rst on Thursday May 27, 2021 @05:50PM
(#27309010)
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...
[ Parent
| on HN ]
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.