[patch, libgfortran] PR32611 Print sign of negative zero

Tobias Burnus burnus@ph2.uni-koeln.de
Tue Jul 10 06:21:00 GMT 2007


> On Mon, Jul 09, 2007 at 07:57:44PM -0700, Jerry DeLisle wrote:
> > Do you think it better to have a separate compiler option like
> > -fsign-zero?

I like this idea. Other compilers have similar things:

ifort has "-assume minus0"
-------------
Tells the compiler to use Fortran 95 standard semantics for the treatment
of  the IEEE* floating value -0.0 in the SIGN intrinsic, which
distinguishes the difference between -0.0 and +0.0, and to write a value
of -0.0 with a negative sign on formatted output. The default is -assume
nominus0, which tells the compiler to use Fortran 90/77 standard semantics
in the SIGN intrinsic to treat -0.0 and +0.0 as 0.0, and to write a value
of 0.0 with no sign on formatted output.-------------

NAG f95: "-f90_sign  Use the Fortran 77/90 version of the SIGN intrinsic
instead of the Fortran 95 one (they differ in the treatment of negative
zero)."
g95 has the enviornment variable "G95_MINUS_ZERO".

Steve Kargl wrote:
> I'd rather see -std=f77.
I prefer -fsign-zero or similar: First, it is also part of Fortran 90 not
only of FORTRAN 77; secondly, I know no one who wants to go through all
restrictions of F77 to create a -std=f77 option.
> For -std=gnu, which is the default behavior, gfortran should output the
> minus.
I agree.

Tobias




More information about the Fortran mailing list