Built-in testing for signaling nan?
N.M. Maclaren
nmm1@cam.ac.uk
Wed Nov 6 18:09:00 GMT 2013
>> Yes, due to the poor quality of the IEEE 754 specifications. In 1984,
>> the distinction was left completely unspecified (even in intent). In
>> 2008, there is a recommendation (no more) that the top bit of the payload
>> is used, with no specification of what to do if that is zero (which is
>> the most obvious default). That appears to be the Intel specification,
>> though it may not have always been so even for x86. I have certainly
>> seen more than one convention for different architectures, but have no
>> idea how many are extant nor how many are documented in the relevant
>> architecture manuals.
>
>In GCC, the qnan_msb_set bit of struct real_format is what specifies the
>convention in use for a particular floating-point mode.
A single bit necessarily conveys at most one bit of information.
That can indicate whether the MSB being zero is the criterion;
it cannot indicate what the criterion is if that is not the case.
Regards,
Nick Maclaren.
More information about the Fortran
mailing list