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]

Re: Fourth Draft "Unsafe fp optimizations" project description.



>ejr@CS.Berkeley.EDU (Jason Riedy)  wrote on 12.08.01 in
><200108130550.WAA23692@lotus.CS.Berkeley.EDU>:
>
>> For a simpler
>> view, does anyone really want to debug programs where
>> you cannot rely on equality?
>
>If there's one thing I've seen or heard in just about *every*
>discussion of computer floating point, it is that you cannot rely on
>equality. Just about every single one makes the point that with
>floating  point, "A == B"  is *wrong*, you want "abs(A-B) < some_small_value".
> MfG Kai

IEEE tries to improve on that situation, and the point was that in
flush-to-zero arithmetic comparison of very small numbers is somewhat
problematic.  If you take A==B to mean bit-for-bit identity, then you
have many pairs A != B yet A - B == 0.  If you take A - B = 0
as the definition of A == B, then there are still many pairs
that are not bit-for-bit identical yet they compare equal.

Whatever the IEEE 754 committee may say about it, however, the fact is
that vendors are going to continue to offer flush to zero machines
because there are good engineering reasons to do so.  It would be most
helpful if the committee would seek to determine and codify the
industry practice.  It will be much less helpful if the committee
comes out with unpracticed rules that the industry is going to ignore
as it has already done in the past.


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