numeric question about usage of signaling NaNs
David G Hough at validlab.com
validlabavalidlab.com
Fri Aug 23 15:29:43 PDT 2002
At the 754R meeting yesterday, a question arose: is anybody actually
using 754's signaling NaNs? The only actual usage those present at the
meeting were familiar with was using signaling NaNs to initialize storage
for debugging purposes. The claim was made that modern debugging tools
are able to catch any uninitialized storage accesses that signaling NaNs
could catch.
In any event, the most convenient way of uninitializing storage to all-ones
bits doesn't work on most existing 754
platforms because the all-ones patterns are defined
to be quiet rather than signaling NaNs.
Signaling NaN's were originally included in the standard to facilitate
experimentation with extensions like OV and UN symbols, or extra-precise
or extra-exponent representations of numbers. Actually setting up such
an experiment requires a fair amount of operating system and
application support
since every operation on a signaling NaN must be trapped, a correct value
computed from the NaN's value and the other operand, and a new signaling
NaN generated to hold the intended result, and execution somehow resumed.
So any such application would
probably be rather platform-dependent. In contrast, ordinary quiet
NaNs, once generated to reflect exception conditions, propagate quietly
in ways that are very similar on all 754 platforms.
A number of aspects of 754, such as conversion between binary and
decimal character strings, are complicated by the need to support signaling
NaNs, to the extent that 754R contemplates removing the requirement that
implementations provide signaling NaN patterns.
More information about the Numeric-interest
mailing list