(j3.2006) REAL with NaN argument
Malcolm Cohen
malcolm
Wed Jul 2 20:10:34 EDT 2014
>Should one expect
>
> double precision :: D
> D = IEEE_Value(1.0e0,IEEE_Signaling_NaN)
>
>to produce a double-precision signaling NaN?
No.
"any operation signaling an invalid operation exception and for which a
floating-point result is to be delivered shall deliver a quiet NaN"
and
"Signaling NaNs shall ... signal the invalid operation exception ... for every
general-computational and signaling-computational opertion except for the
conversions listed in 5.12"
Converting one floating-point format to another is a general-computational
operation described in 5.4.2, therefore converting single precision SNaN to
double precision is required to signal (and return a quiet NaN).
Of course that's for IEEE-compliant conversions, which we don't actually
require, so you're not *guaranteed* to get the exception signalled plus a quiet
NaN, but it seems likely on most systems.
>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.
Good.
> Should they?
No.
Cheers,
--
................................Malcolm Cohen, Nihon NAG, Tokyo.
More information about the J3
mailing list