quick bug report
Tobias Burnus
burnus@net-b.de
Fri Dec 7 19:01:00 GMT 2007
Ilias Miroslav wrote:
> ..see the attachement
Note that
double precision, parameter :: NegInf = Z'FFF0000000000000'
is not well defined and not standard Fortran 77/90/95/2003/2008.
In gfortran the BOZ, i.e. the Z'FFF0000000000000', is interpreted as
INTEGER of the value 18442240474082181120. If you convert it now to
double precision, the result is 1.84422404740821811E+019 which is
obviously not -Infinity.
Several compilers regard in this case the Z'FFF0000000000000' as bit
pattern, which gives indeed -Inf; as of now gfortran does not!
You could try the following (using "-fno-range-check"):
double precision,parameter :: NegInf = -1.0/0.0
Or using gfortran 4.3:
double precision,parameter :: NegInf = &
transfer(Z'FFF0000000000000', 0d0)
Tobias
PS: There is a patch pending, which allows to do what you want:
http://gcc.gnu.org/ml/fortran/2007-12/msg00075.html
More information about the Fortran
mailing list