4 ms·
The 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
by smallnamespace 8y ago
The 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.