Re:Pretty.c
by slimsag on Thursday October 24, 2024 @02:11AM
(#41932438)
it uses absolute difference epsilon equality ('close enough to be considered equal'):
[ Parent
| on HN ]
This is wrong code. It only works somewhat correctly when a and b around 1.
Yeah, should be scaled like |x - y| <= ε * max(|x|, |y|)
Will do.
If both terms are infinites and of same sign, subtraction will give NaN and it will fail.
How is that a problem? infinities shouldn't be considered equal