4 ms·
> If that assumption happens to hold for all the systems that could is meant to run on, why shouldn't you make it? Because what's going to happen two years dow
by GFK_of_xmaspast 11y ago
> If that assumption happens to hold for all the systems that could is meant to run on, why shouldn't you make it?
Because what's going to happen two years down the road when you need to get that code working on a different platform.
(In the old days, they called that thinking "all the world's a VAX", which became "all the world's linux" in the not-quite-as-old days)
- lultimouomo 11y ago> Because what's going to happen two years down the road when you need to get that code working on a different platform. And what happens when the different platform handles overflow differently? Or has non-IEEE floats? Or breaks whatever assumption the C standard already makes? Here's the thing: C is already built on assumptions, which might or might not hold for a specific platform. Choosing which assumptions we hold true is a pragmatic choice that must be done. C does it, and does it consciously - but it doesn't mean that it nails every choice.
- GFK_of_xmaspast 11y agoIf you're in a situation where you need specific implementation details of floating point arithmetic, then may the devil have mercy on your soul, because god certainly won't.
- Solarsail 11y agoWouldn't debugging / testability imply this is a fairly large proportion of programs? Having a calculation give different results on different hardware would make testing difficult: http://yosefk.com/blog/consistency-how-to-defeat-the-purpose-of-ieee-floating-point.html http://yosefk.com/blog/consistency-how-to-defeat-the-purpose...
- GFK_of_xmaspast 11y agoYour own link explains how easy it is to get different results even on the same hardware depending on compiler flags.