3 ms·
value types where the only possible way to represent them is with a single "canonical form." But IEEE754 allows not only NaNs, but also "negative zero" and deno
by wruza 4y ago
value types where the only possible way to represent them is with a single "canonical form."
But IEEE754 allows not only NaNs, but also "negative zero" and denormals
Unicore strings also have normalization forms. Not to make an argument, just a reminder.
- derefr 4y agoTrue — but Unicode strings that are not bit-equal aren't collation-equal either, so that doesn't usually matter. A non-canonicalized Unicode string won't "find" its canonical counterpart in a hashtable. IEEE754 floats (and doubles) are kind of unique among scalar types, in that the answer to "are these equal" in pretty much every programming language is delegated directly to the CPU to answer; and, in obeying IEEE754 semantics, the CPU's definition of equality for FP numbers makes things equal that aren't bit-representation-equal.