viirya commented on PR #3510:
URL: https://github.com/apache/arrow-rs/pull/3510#issuecomment-1379686171

   I see. That explains why these NaNs are equal. I roughly remember that from 
JVM experience NaN values' bits are different so I was a bit surprised to see 
they are equal in above test/play-ground. If there are other bit patterns in 
Rust that will be seen as NaN too, then it is not guaranteed to be equal.
   
   NaNs should be treated as equal in computation too, like zeros.
   
   Either adding NaN-specific condition like zero, or we avoid such things here 
and require users to handle it before calling arrow kernels. For example, 
replacing negative zeros with positive zeros, normalizing NaNs with standard 
f32::NaN (f64, f16 too).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to