3 ms·
> It is more or less impossible to peek under the hood. There is no way to teach integer logic really (Python has auto-growing arbitrary precision integers) and
by NAFV_P 13y ago
> It is more or less impossible to peek under the hood. There is no way to teach integer logic really (Python has auto-growing arbitrary precision integers) and floats can lead to strange errors (x=1; for i in range(10): x+=0.1 does not yield 2).
I believe the same problem applies to C, and any program that employs a float register. 0.1 cannot be defined accurately in a float, there is incompatibility between a base 10 system and a base 2 system. This should be true no matter the size of the register. The larger the register, the more precision you get, but you don't get more accuracy.