(j3.2006) REAL with NaN argument

Robert Corbett robert.corbett
Thu Jul 3 00:28:53 EDT 2014


On 07/02/14 20:34, Bill Long wrote:
>
> 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.
>
Early releases of Sun Fortran for x86 signaled an invalid exception and returned 
a quiet NaN.  Later releases copy the signaling NaN.  Sun Fortran for SPARC 
copied signaling NaNs since before I joined Sun.

Bob Corbett



More information about the J3 mailing list