fb913bf0de288ba84fe98f7a23d35edfdb22381 opened a new pull request, #6110: URL: https://github.com/apache/iceberg/pull/6110
This commit changes the hashing of float/double for negative zero (-0.0) to produce the same hash as for positive zero (0.0). This is needed because positive/ negative zero are considered equal according to ==, but have distinct bit patterns according to Double#doubleToLongBits. Therefore, using these bit patterns directly would violate the assumption "x = y implies bucket(x) = bucket(y)". With this commit, the bit pattern for negative zero is replaced with the bit pattern for positive zero before hashing, to ensure both produce the same hash. Double negative zero has the bit pattern 0x8000000000000000, (which matches the bit pattern of Long.MIN_VALUE), whereas the bit pattern for positive zero is 0x0000000000000000. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org