-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
GH-44915: [C++] Add WithinUlp testing functions #44906
Conversation
Initially mentioned in #12681 (comment) |
@github-actions crossbow submit -g cpp |
This comment was marked as outdated.
This comment was marked as outdated.
@github-actions crossbow submit -g cpp |
This comment was marked as outdated.
This comment was marked as outdated.
@github-actions crossbow submit -g cpp |
Revision: ad2bf4f Submitted crossbow builds: ursacomputing/crossbow @ actions-5787e09ddf |
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.
LGTM
#include "arrow/testing/visibility.h" | ||
|
||
namespace arrow { | ||
|
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 argument name in within is n_ulp
, but in assertWithin is n_ulps
?
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.
Hmm... no reason I'm afraid. We can open a minor PR to fix that.
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 0d8c8d9. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 52 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
When testing math-related functions, we might want to check that some results are very close to an expected value, but not necessarily exactly equal.
What changes are included in this PR?
Add functions that test whether two floating-point values are within N ulps.
("ulp" stands for "unit in the last place": https://en.wikipedia.org/wiki/Unit_in_the_last_place)
Are these changes tested?
Yes.
Are there any user-facing changes?
Potentially more useful error messages.