NaN - Encoding

Encoding

In IEEE 754 standard-conforming floating point storage formats, NaNs are identified by specific, pre-defined bit patterns unique to NaNs. The sign bit does not matter. Binary format NaNs are represented with the exponential field filled with ones (like infinity values), and some non-zero number in the significand (to make them distinct from infinity values). The original IEEE 754 standard from 1985 (IEEE 754-1985) only described binary floating point formats, and did not specify how the signaled/quiet state was to be tagged. In practice, the most significant bit of the significand determined whether a NaN is signalling or quiet. Two different implementations, with reversed meanings, resulted.

  • most processors (including those of the Intel/AMD x86-32/x86-64 family, the Motorola 68000 family, the AIM PowerPC family, the ARM family, and the Sun SPARC family) set the signaled/quiet bit to non-zero if the NaN is quiet, and to zero if the NaN is signaling. Thus, on these processors, the bit represents an 'is_quiet' flag.
  • in NaNs generated by the PA-RISC and MIPS processors, the signaled/quiet bit is zero if the NaN is quiet, and non-zero if the NaN is signaling. Thus, on these processors, the bit represents an 'is_signaling' flag.

The 2008 revision of the IEEE 754 standard (IEEE 754-2008) makes formal recommendations for the encoding of the signaled/quiet bit.

  • For binary formats, the standard follows the interpretation as an 'is_quiet' flag. I.e. the signaled/quiet bit is non-zero if the NaN is quiet, and zero if the NaN is signaling. The 'is-quiet' bit should be the most significant bit of the significand.
  • For decimal formats, whether binary or decimal encoded, a NaN is identified by having the top five bits of the combination field after the sign bit set to ones. The sixth bit of the field is the 'is_quiet' flag. The standard follows the interpretation as an 'is_signaling' flag. I.e. the signaled/quiet bit is zero if the NaN is quiet, and non-zero if the N is identified by having the aN is signaling.

The state/value of the remaining bits (i.e. other than the ones used to identify a NaN as NaN, including the quiet/signaled bits) are not defined by the standard except that they must not be all zero. This value is called the 'payload' of the NaN and the recommendation is to pass the value of the first qNaN operand through operations when generating an output qNaN to assist with debugging.

Read more about this topic:  NaN

Other articles related to "encoding, encodings":

Charset Detection
... Character encoding detection, charset detection, or code page detection is the process of heuristically guessing the character encoding of a series of ... is due to the large percentage of invalid byte sequences in UTF-8, so that text in any other encoding that uses bytes with the high bit set is ... UTF-8 test first, and may decide that UTF-8 is some other encoding ...
ADETTI - 2004-2006 FP6 IST STREP WCAM
... The following elements will be used in the WCAM system Adaptive encoding techniques allowing the inclusion of scene analysis in the optimisation of the video encoding as well as generating rich ... State of the art visual encoding schemes, H.264 and MotionJPEG 2000 Internetworking and adaptive Quality of service features Security, both on the network and the content level Multimedia storage and distribution” ...
Sc RGB - Encoding
... Two encodings are defined for the individual primaries a linear 16 bit per channel encoding and a nonlinear 12 bit per channel encoding ... The 16 bit scRGB(16) encoding is the linear RGB channels converted by ... The 12-bit scRGB-nl encoding is the linear RGB channels passed through the same gamma function as sRGB (for negative numbers use -f(-x)) and then converted by ...
Space Communications And Navigation Program - Communications Schemes - Encoding
... used for near-Earth communications) supports the following encoding schemes BPSK QPSK/SQPSK 8PSK Rate 1/2 convolutional coding SQPN PRN coding - used ... initial error-correcting block code prior to the selected secondary encoding scheme ...
Sub-band Coding - Encoding Audio Signals
... In effect, many bits are wasted in encoding masked portions of the signal because PCM makes no assumptions about how the human ear hears ... A classic method is nonlinear PCM, such as mu-law encoding (named after a perceptual curve in auditory perception research) ... Sun's Au file format for sound is a popular example of mu-law encoding ...