4 ms·
So, you want to redefine IEEE floats? 'cause it says that there is no ordering for NaNs. And if you do redefine IEEE floats, where do NaNs go, and why is that
by brucedawson 10y ago
So, you want to redefine IEEE floats? 'cause it says that there is no ordering for NaNs.
And if you do redefine IEEE floats, where do NaNs go, and why is that better?
- kobeya 10y agoI'm saying IEEE shouldn't have defined them that way, yes. It was an arbitrary choice. As to where, before negative infinity or after positive infinity; I don't really care which. But the fact that we can't have good things (e.g. a standards compliant std::set<float>) because of a standards committee punted on making that choice makes me sad :(
- Sharlin 10y agoI do wonder why they didn't special-case std::less for floats. They already did it for pointers - operator< for pointers isn't even defined, much less a strict weak order, if the operands do not point to the same object (region of storage). This is in order to facilitate non-flat addressing schemes. std::less, however, is explicitly specified to work with any pair of pointers.