This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Porposal: Floating-Point Options


Russell Shaw wrote:

The original bug was about testing the equality of doubles. I think that's
just plain mathematically bad. Error bands should be used to test for
"equality", using a band that is in accordance with the minimum precision
specified in the compiler documentation.

That's often taught, but in fact there are many IEEE algorithms where it makes perfectly good sense to test for absolute equality.

OTOH, maybe the equality operators should discard the excess precision, so
effectively implementing the error band anyway. Can't say more without reading
the relevant standards. If the equality operators did this, then it shouldn't
slow down any non-equality operators or anything else.

But it would, quite unnecessarily, slow down equality.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]