There is specially handling for not-a-number (NaN) when dealing with
double types that does not exactly match standard floating point semantics. Specifically:
- NaN = NaN returns true.
- In aggregations, all NaN values are grouped together.
- NaN is treated as a normal value in join keys.
- NaN values go last when in ascending order, larger than any other numeric value.