← 返回首页
Use boost's epsilon difference when comparing floating point values by umar456 · Pull Request #3212 · arrayfire/arrayfire · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

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

Merged
umar456 merged 2 commits into
arrayfire:masterfrom
umar456:half_test_fix
Feb 21, 2022
Merged

Use boost's epsilon difference when comparing floating point values#3212
umar456 merged 2 commits into
arrayfire:masterfrom
umar456:half_test_fix

Conversation

Copy link
Copy Markdown
Member

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 added the test label Feb 7, 2022
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 added this to the 3.8.2 milestone Feb 19, 2022
Copy link
Copy Markdown
Member

9prady9 left a comment

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

looks good to me

umar456 merged commit 3330090 into arrayfire:master Feb 21, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.