yshcz opened a new issue, #1951:
URL: https://github.com/apache/iceberg-rust/issues/1951

   ### Apache Iceberg Rust version
   
   0.6.0 (latest version)
   
   ### Describe the bug
   
   This is a bit pedantic but iceberg-rust uses 
[`partial_cmp`](https://github.com/apache/iceberg-rust/blob/v0.7.0/crates/iceberg/src/spec/values.rs#L245)
 for float/double comparison in the `iceberg_float_cmp` function, which treats 
-0.0 and +0.0 as equal, violating the function's own comments about the 
expected ordering.
   
   The existing test `test_iceberg_float_order` uses `assert_eq!`, which cannot 
detect ordering differences between -0.0 and +0.0 since underlying f64(or f32) 
treats them as equal.
   
   Using f64's `total_cmp` instead would likely fix this.
   
   ### To Reproduce
   
   ```rust
   #[test]
   fn test_negative_zero_less_than_positive_zero() {
       let neg_zero = Datum::float(-0.0);
       let pos_zero = Datum::float(0.0);
   
       assert_eq!(
           neg_zero.partial_cmp(&pos_zero),
           Some(Ordering::Less),
           "IEEE 754 totalOrder requires -0.0 < +0.0"
       );
   }
   ```
   
   Current: `Some(Ordering::Equal)`
   Expected: `Some(Ordering::Less)`
   
   
   ### Expected behavior
   
   _No response_
   
   ### Willingness to contribute
   
   None


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to