3 ms·
Computers can be made to understand base 10 though, if needed. We do so routinely when amounts of money are involved so a cent is a cent, even though 1/100 is n
by moring 6y ago
Computers can be made to understand base 10 though, if needed. We do so routinely when amounts of money are involved so a cent is a cent, even though 1/100 is nonterminating as a binary fraction.
- a1369209993 6y agoBy that logic they can be made to understand base twelve (et al) just as well. And 0x64 cents is perfectly reasonable amount of money, but that's because it's a integer, not a fraction.
- Gibbon1 6y agoBrings up someone I read from an old crusty programmer, binary floating point is the wrong tool for most things. It's fine for scientific simulation work. But for everything else it causes no end of problems.
- a1369209993 6y agoFloating point, binary or otherwise, is the wrong tool for many things. (Although (not-necessarily-scientific) simulation work is a very broad class of things.) If you're doing anything related to accounting, there is no excuse not to be using integers.