2 ms·
It would solve more common issues like this though: > I appreciate that it may be surprising that 0.1 + 0.2 != 0.3 at first, or that many people are not educat
by ummonk 8y ago
It would solve more common issues like this though:
> I appreciate that it may be surprising that 0.1 + 0.2 != 0.3 at first, or that many people are not educated about floating point, but I don't understand the people who "understand" floating point and continue to criticize it for the 0.1 + 0.2 "problem."
That's not a calculation that should require a high level of precision.
- smallnamespace 8y agoThe correct solution is to understand how floating point number systems work and use near comparisons for floats. Decimal fp is still 'wrong' for, say, 1/3 + 1/3 = 2/3.
- int_19h 8y agoA lot of real-world data is already in base-10 for obvious reasons, and so an arrangement that lets you add, subtract and multiply those without worrying is worthwhile, even if it can't handle something more exotic.
- smallnamespace 8y agoWould you really call 'any rational with divisible factors other than 2 and 5' to be 'exotic'? Maybe we really should move back to base-60 like the Babylonians used, then you could at least divide by 3.
- int_19h 8y agoBecause humans standardized on base-10, and computers are ultimately for humans to use?
- MauranKilom 8y agoMaybe we should also add data types to every language that can convert exactly between inches, feet, miles and every other non-base-10 unit? The argument "we want to look at base-10 in the end so it should be the internal representation" is really weak and ignores basically every other practical aspect.