[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
NaN Not a Number

NaN stands for `Not a Number' meaning that it has no relationship with any other number. A NaN is neither greater,less, or equal to a number. Whereas infinity is comparable to a number that is, it is greater than all numbers and negative infinity is less than all numbers.
There are two types of NaN's the signalling and quiet. The difference between a signalling NaN and quiet NaN is that both have a full exponent and both have at least one non zero significant bit, but thesignalling NaN has it's 2 most significant bits as 1 where a quiet NaN has only the second most significant bit as 1.
Quiet NaN
A quiet NaN is the result of an indeterminatecalculation such as zero divided by zero, infinity minus infinity. The IEEE floating-point standard guarantees that quiet NaN's are detectable by requiring that the invalid exception be raised whenever a NaN appears as an operand to any basic arithmetic(+,/,-,*) or non-arithmetic operation(load/store). Metrowerks Standard Library follows the IEEE specification.
Signaling NaN
A signalling NaN does not occur as a result of arithmetic. A signalling NaN occurs when you load a bad memory value into a floating point register that happens to have the same bit pattern a signalling NaN. IEEE 754 requires that in such a situation the invalid exception be raised and the signalling NaN be coverted to a quiet NaN so the lifetime of a signalling NaN may be brief.
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000