3 ms·
The only point I'll concede is monetary calculations. Estimating distances? Layout? I can't see how the difference between decimal and binary changes anything.
by mark-r 7y ago
The only point I'll concede is monetary calculations. Estimating distances? Layout? I can't see how the difference between decimal and binary changes anything.
Decimal math isn't built into most of the languages or processors we use, so that's why I keep asking what you'll use. It's a kind of hand-wavy response. You'll need to seek out an appropriate library and use it consistently, which is a lot more trouble than just using the built-in IEEE. Not impossible, just usually more trouble than it's worth.
- coldtea 7y ago>Estimating distances? Layout? I can't see how the difference between decimal and binary changes anything. Whether it changes everything is neither here not there. It might still result in the same output (e.g. the lack of precision might not matter for layout purposes), but there's absolutely no domain need to do the calculations in FP except for performance or lack of a better number type in the language. In all of these cases, the exact match would be better than lack of precision, aside from the performance and similar (memory, etc) costs. That is, if decimal was computing-wise as fast and as available as FP, there would be absolutely no reason to use FP. It's not a choice of mathematical need (e.g. not imposed by the calculation) but a choice of computing constraints. >Decimal math isn't built into most of the languages or processors we use, so that's why I keep asking what you'll use. In my experience many languages have it (C#, Java, Python, Javascript is getting it, etc) and people don't use it. And in most cases, being in the processors wouldn't matter - we use FP for all kinds of non-critical performance calculations, not because it's needed for the speedup, but because it's there. When there is indeed a need for the CPU-support, I'd use FP myself, sure. But not in most other cases, and absolutely not for money and other cases where precision matters (but people still use FP).