[Bug target/25960] __gcc_add doesn't handle -0.0L properly

geoffk at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Feb 2 08:50:00 GMT 2006



------- Comment #6 from geoffk at gcc dot gnu dot org  2006-02-02 08:50 -------
I agree with Alan.

Although the format is not compatible with IEEE arithmetic, this applies only
because the arithmetic is different, not the handling of special cases.  In
every case where the inputs are exactly representable as a double (including
+/-0, Inf, and NaN) and 'double' arithmetic would be exact, the result of the
computation in this 'long double' representation should be the same as if it
had been done in 'double'.

As for the patch, it looks right to me, but it's probably better for
performance if instead it does

if (zz == 0.0)
  return z;


-- 

geoffk at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25960



More information about the Gcc-bugs mailing list