Skip to content

feat(numbers): added InEpsilonSymmetric - #109

Merged
fredbi merged 1 commit into
go-openapi:masterfrom
fredbi:feat/numbers-close
Apr 26, 2026
Merged

feat(numbers): added InEpsilonSymmetric#109
fredbi merged 1 commit into
go-openapi:masterfrom
fredbi:feat/numbers-close

Conversation

@fredbi

@fredbi fredbi commented Apr 26, 2026

Copy link
Copy Markdown
Member

This variant of InEpsilon (also available as a generic assertion), uses a modified relative error, so that both operands play a symmetric role.

This is useful when the "expected" value doesn't play a particular role when asserting that 2 numbers are close. Mirrors python's math.isclose.

Refers to: stretchr#1839

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.
This variant of InEpsilon (also available as a generic assertion),
uses a modified relative error, so that both operands play a symmetric
role.

This is useful when the "expected" value doesn't play a particular role
when asserting that 2 numbers are close. Mirrors python's math.isclose.

Refers to: stretchr#1839

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@codecov

codecov Bot commented Apr 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.56%. Comparing base (d7d18ce) to head (d7bea63).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #109      +/-   ##
==========================================
+ Coverage   91.50%   91.56%   +0.06%     
==========================================
  Files          97       97              
  Lines       12306    12405      +99     
==========================================
+ Hits        11260    11359      +99     
  Misses        825      825              
  Partials      221      221              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fredbi
fredbi merged commit 5631839 into go-openapi:master Apr 26, 2026
23 checks passed
@fredbi
fredbi deleted the feat/numbers-close branch April 26, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant