LuciferYang commented on code in PR #861:
URL: https://github.com/apache/iceberg-cpp/pull/861#discussion_r3681427001
##########
src/iceberg/expression/literal.cc:
##########
@@ -444,7 +444,9 @@ std::strong_ordering CompareFloat(T lhs, T rhs) {
// and -NAN < NAN.
bool lhs_is_negative = std::signbit(lhs);
bool rhs_is_negative = std::signbit(rhs);
- return lhs_is_negative <=> rhs_is_negative;
+ // A negative sign bit sorts below a positive one (-NaN < +NaN), so a
+ // negative operand must compare as less.
+ return rhs_is_negative <=> lhs_is_negative;
Review Comment:
Keeping `rhs <=> lhs`: it's the idiom for reversing the order relation, and
the comment above states the intent. The `SignedNaNComparison` tests pin the
direction either way.
--
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]