Both of the above hinge on the relative obscurity of NaNs and the problems they could cause. People who are not specifically familiar with NaNs and how they interact with other floating-point values will treat floating-point values as "just numbers", and expect them to compare and sort in the same way as integers.

Please, please, please just no. As someone who works with floating point daily, you cannot idiot proof it like this. They will never behave like "just numbers" and you can't make them.

Even leaving out NAN, you have issues with precision, accumulated error, denormals, equality comparison, and on and on.

If you don't know what you are doing with them, then you just shouldn't be touching them. Unicode has similar issues.

Reply via email to