approxEqual() has fooled me for a long time...

Walter Bright newshound2 at digitalmars.com
Wed Oct 20 11:54:48 PDT 2010


Andrei Alexandrescu wrote:
> Any ideas? The feqrel and approxEqual story does seem to suggest that 
> names (and by extension syntax) are important.

When doing real engineering calculations, we think in terms of "significant 
digits" of accuracy, not accurate to .001. The within(1e-5) is seductively wrong.

Something like matchBits(a,b,nbits) and matchDigits(a,b,ndigits) would be better.


More information about the Digitalmars-d mailing list