signed zeros

Jack Howarth howarth@bromo.med.uc.edu
Fri Jul 30 02:33:00 GMT 2010


On Thu, Jul 29, 2010 at 07:11:14PM -0700, Steve Kargl wrote:
> 
> Because -fno-sign-zero and -fno-signed-zeros are different options.
> 
> >From the gfortran documentation:
> 
> `-fsign-zero'
>      When enabled, floating point numbers of value zero with the sign
>      bit set are written as negative number in formatted output and
>      treated as negative in the `SIGN' intrinsic.  `fno-sign-zero' does
>      not print the negative sign of zero values and regards zero as
>      positive number in the `SIGN' intrinsic for compatibility with F77.
>      Default behavior is to show the negative sign.
> 
> >From gcc documentation:
> 
> `-fno-signed-zeros'
>      Allow optimizations for floating point arithmetic that ignore the
>      signedness of zero.  IEEE arithmetic specifies the behavior of
>      distinct +0.0 and -0.0 values, which then prohibits simplification
>      of expressions such as x+0.0 or 0.0*x (even with
>      `-ffinite-math-only').  This option implies that the sign of a
>      zero result isn't significant.
> 
>      The default is `-fsigned-zeros'.
> 

Thanks for the clarification. It's unfortunate that those two options ended
up so similar in name. Perhaps -fsigned-zero-io would have been better.
            Jack

> -- 
> Steve



More information about the Fortran mailing list