-
Notifications
You must be signed in to change notification settings - Fork 924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REVIEW] Adding floating point specialization to comparators for NaNs #3239
[REVIEW] Adding floating point specialization to comparators for NaNs #3239
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-0.11 #3239 +/- ##
============================================
Coverage 87.13% 87.13%
============================================
Files 49 49
Lines 9269 9269
============================================
Hits 8077 8077
Misses 1192 1192 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some concerns about the semantics and the overheads.
@rgsl888prabhu a pattern like this is more along the lines of what I was envisioning:
This should vastly simplify the implementation you have here. |
@jrhemstad So, we will have two sets of functions one for floating point and other for non-floating type. |
Yes, but it's limited to the logic that needs to be specialized between floating/non-floating types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small change, otherwise looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you just need to merge the latest branch-0.11
into your PR to get CI to pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clean solution.
* @brief A specialization for floating-point `Element` type rerlational comparison | ||
* to derive the order of the elements with respect to `lhs`. Specialization is to | ||
* handle `nan` in the order shown below. | ||
* `[-Inf, -ve, 0, -0, +ve, +Inf, NaN, NaN, null] (for null_order::AFTER)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does NaN appear twice in these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To show NaN == NaN
Added floating point specialization to comparators for NaNs and test cases to evaluate.
close #3226