andishgar commented on issue #46739:
URL: https://github.com/apache/arrow/issues/46739#issuecomment-2958481828

   @shreyavarma99 Thank you for addressing this issue. I forgot to mention an 
additional note (sorry for that). The same problem occurs with signed zero as 
well.
   ```c++
   TEST(FloatComparasion, float16) {
   
     auto f1 = util::Float16::FromDouble(+0.0);
     auto f2 = util::Float16::FromDouble(-0.0);
     ASSERT_TRUE(f1.is_zero());
     ASSERT_TRUE(f2.is_zero());
     ASSERT_TRUE(f2.signbit());
     HalfFloatScalar scalar_1(f1.bits());
     HalfFloatScalar scalar_2(f2.bits());
   
     f1 = util::Float16::FromBits(scalar_1.value);
     f2 = util::Float16::FromBits(scalar_2.value);
     ASSERT_TRUE(f1.is_zero());
     ASSERT_TRUE(f2.is_zero());
     ASSERT_TRUE(f2.signbit());
     ASSERT_FALSE(
         scalar_1.Equals(scalar_2, 
EqualOptions::Defaults().signed_zeros_equal(true)));
     ASSERT_FALSE(
         scalar_1.Equals(scalar_2, 
EqualOptions::Defaults().signed_zeros_equal(false)));
   }
   ``` 
   


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