feat(numbers): added InEpsilonSymmetric by fredbi · Pull Request #109 · go-openapi/testify (original) (raw)
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.