Walter:

> There's a total lack of evidence for that.

MISRA-C standard disallows the equality among FP values. I presume they have 
some serious evidence for their choices, but I don't know such evidence. Today 
MISRA-C is one of the most serious attempts at fixing the holes in C language 
to write more reliable code for the industry. MISRA-C standard is sometimes 
extreme and I don't suggest to follow everything they say, but I suggest to not 
totally ignore what it says about many C features.


> 1. Roundoff error is not of a fixed magnitude.

I meant to replace the nude FP equality with a function that has the shared 
number of mantissa bits as third required argument. And then perform the normal 
FP equality using the "is" operator.

Regarding FP rounding errors, eventually it will be good to add to Phobos2 a 
library for Interval FP arithmetic, with trigonometric functions too, etc:
http://en.wikipedia.org/wiki/Interval_arithmetic

Bye,
bearophile

Reply via email to