Mar-04-2024, 02:02 PM
(This post was last modified: Mar-04-2024, 02:11 PM by Gribouillis.)
(Mar-04-2024, 06:59 AM)akbarza Wrote: what is your opinion about it?Choice 2 occurs for example if Python is implemented using IEEE754 with 64 bits, that is to say 11 bits of exponent and 52 bits of mantissa plus the sign bit. This is usually the case. It would also be the choice if Python was implemented using 128 bits or 256 bits.
1)True
2)False
3) machine dependence
4)...
choice 3, machine dependence is not true?
I don't think the choice of 64 bits is enforced in the specification of the Python language.
I made tests that showed that if a machine implemented IEEE754 on 65 bits instead of 64, that is to say 53 bits of mantissa instead of 52, then on such a machine, 0.1 + 0.2 == 0.3 would be true, so Choice 3 is a valid choice since we can't exclude that someone is crazy enough to implement Python with mad architectures.
« We can solve any problem by introducing an extra level of indirection »