v.20.8Improvement

Function arrayCompact Now Compares NaNs Bitwise for Float32/Float64 Types

Function arrayCompact will compare NaNs bitwise if the type of array elements is Float32/Float64. In previous versions NaNs were always not equal if the type of array elements is Float32/Float64 and were always equal if the type is more complex, like Nullable(Float64). This closes #13857. #13868 (alexey-milovidov).
The arrayCompact function now performs bitwise comparison of NaNs for arrays with Float32/Float64 element types, ensuring consistent handling of NaN values.

Why it matters

Previously, NaNs in arrays of Float32/Float64 elements were always treated as not equal by arrayCompact, while NaNs in more complex types (e.g., Nullable(Float64)) were treated as equal. This feature resolves inconsistencies in NaN comparison, allowing arrayCompact to correctly identify and compact NaN duplicates in floating-point arrays.

How to use it

Use the arrayCompact function as before on arrays containing Float32 or Float64 elements. The NaN values will now be compared bitwise internally without any additional configuration.