Re:John Gustafson’s crusade to replace floating point with s...
by desdiv on Tuesday July 09, 2019 @02:19AM
(#20389408)
Yes, that's a hard bug to catch, but if the mantra of "every floating point comparison must use a context-appropriate epsilon" is followed, then it wouldn't have happened in the first place.
[ Parent
| on HN ]
Re:John Gustafson’s crusade to replace floating point with s...
by stkdump on Tuesday July 09, 2019 @08:00AM
(#20390910)
I hate that mantra, as it produced more bugs and inaccuracies in the code I have to work with than necessary. Actually you should be able to rely on the equality of a value with its copy no matter what. We are past the FPU days, so I think we can let go of these mindless epsilons sprinkled over the code.
(Even during the FPU days, every ; should have rounded each value to the size of the variables, unless you use a special compiler switch to make FP math faster)