3.6 Floatingpoint
Connected: An Internet Encyclopedia
3.6 Floatingpoint
Up:
Connected: An Internet Encyclopedia
Up:
Requests For Comments
Up:
RFC 1832
Up:
3. XDR DATA TYPES
Prev: 3.5 Hyper Integer and Unsigned Hyper Integer
Next: 3.7 Doubleprecision Floatingpoint
3.6 Floatingpoint
3.6 Floatingpoint
The standard defines the floatingpoint data type "float" (32 bits or
4 bytes). The encoding used is the IEEE standard for normalized
singleprecision floatingpoint numbers [3]. The following three
fields describe the singleprecision floatingpoint number:
S: The sign of the number. Values 0 and 1 represent positive and
negative, respectively. One bit.
E: The exponent of the number, base 2. 8 bits are devoted to this
field. The exponent is biased by 127.
F: The fractional part of the number's mantissa, base 2. 23 bits
are devoted to this field.
Therefore, the floatingpoint number is described by:
(1)**S * 2**(EBias) * 1.F
It is declared as follows:
float identifier;
+++++
byte 0 byte 1 byte 2 byte 3  SINGLEPRECISION
S E  F  FLOATINGPOINT NUMBER
+++++
1< 8 ><23 bits>
<32 bits>
Just as the most and least significant bytes of a number are 0 and 3,
the most and least significant bits of a singleprecision floating
point number are 0 and 31. The beginning bit (and most significant
bit) offsets of S, E, and F are 0, 1, and 9, respectively. Note that
these numbers refer to the mathematical positions of the bits, and
NOT to their actual physical locations (which vary from medium to
medium).
The IEEE specifications should be consulted concerning the encoding
for signed zero, signed infinity (overflow), and denormalized numbers
(underflow) [3]. According to IEEE specifications, the "NaN" (not a
number) is system dependent and should not be interpreted within XDR
as anything other than "NaN".
Next: 3.7 Doubleprecision Floatingpoint
Connected: An Internet Encyclopedia
3.6 Floatingpoint
