(j3.2006) REAL with NaN argument

Bill Long longb
Wed Jul 2 23:34:47 EDT 2014


On Jul 2, 2014, at 6:30 PM, Van Snyder <Van.Snyder at jpl.nasa.gov> wrote:

> Should one expect
> 
>  double precision :: D
>  D = IEEE_Value(1.0e0,IEEE_Signaling_NaN)
> 
> to produce a double-precision signaling NaN?

Don?t think so.  If you want a double precision signaling NaN, try this:

D = IEEE_Value( 1.0d0, IEEE_Signaling_NaN)

or, safer (in my opinion)

D = IEEE_Value( D, IEEE_Signaling_NaN)

We have weasel words that allow the processor to cop out on this (14.11.37p8), but the above has worked on all the systems I?ve used since IEEE hardware was included.

Cheers,
Bill

> 
> 7.2.1.2, 7.2.1.3 (in particular, tables 7.8 and 7.9), and 13.7.138,
> don't mention IEEE exceptional values.  Should they?
> 
> 
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3

Bill Long                                                                       longb at cray.com
Fortran Technical Suport  &                                  voice:  651-605-9024
Bioinformatics Software Development                     fax:  651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101





More information about the J3 mailing list