Skip to content

Use boost's epsilon difference when comparing floating point values #3212

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

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

umar456
Copy link
Member

@umar456 umar456 commented Feb 7, 2022

Use epsilon difference to compare floating point values in tests

Description

This commit changes the way we compare floating point values in the
tests to use the boost math's epsilon difference to compare two floating
point values for equality. This is a more accurate form of equality and
handles differences in half float values when the values reach a
certain threshold.

Changes to Users

N/A

Checklist

  • Rebased on latest master
  • Code compiles
  • Tests pass
  • [ ] Functions added to unified API
  • [ ] Functions documented

@umar456 umar456 added the test label Feb 7, 2022
@umar456 umar456 force-pushed the half_test_fix branch 5 times, most recently from 61177aa to e2ff3e4 Compare February 8, 2022 19:40
This commit changes the way we compare floating point values in the
tests to use the boost math's epsilon difference to compare two floating
point values for equality. This is a more accurate form of equality and
handles differences in half float values when the values reach a
certain threshold.
@9prady9 9prady9 added this to the 3.8.2 milestone Feb 19, 2022
Copy link
Member

@9prady9 9prady9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@umar456 umar456 merged commit 3330090 into arrayfire:master Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants