Commit fe1c69f
Fix #1410, Apply fabs to full relative error in UtAssert_DoubleCmpRel
UtAssert_DoubleCmpRel computed fabs((x) - (y)) / (x), applying fabs only
to the numerator. When x is negative the quotient becomes negative, so
the comparison (negative <= Ratio) is always true and the assertion
passes regardless of how far apart x and y are (false positive).
Wrap the entire relative-error expression in fabs so the comparison uses
the magnitude of the relative difference: fabs(((x) - (y)) / (x)).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 790dc84 commit fe1c69f
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
0 commit comments