Binary representation of REAL #'s VAX vs.IRIS
Brent L. Bates AAD/TAB MS294 x42854
blbates at AERO4.LARC.NASA.GOV
Sat Jan 6 00:35:59 AEST 1990
We have a 3130 and the FORTRAN manual shows how REALS and DOUBLE
PRECISION numbers are stored and I am pretty sure it is the same on
the 4D machines. Below is that description:
REAL and DOUBLE PRECISION data elements are represented according to
the proposed IEEE standard described in Computer magazine of March 1981.
The diagrams below illustrate the representation.
__________________________________________
REAL S Exponent Mantissa
------------------------------------------
31 30 23 22 0
| | |
Sign | Mantissa(23 + 1 bits)
Exponent, biased by 127
__________________________________________
DOUBLE PRECISION S Exponent Mantissa
------------------------------------------
63 62 52 31 0
| | |
Sign | Mantissa(52 + 1 bits)
Exponent, biased by 1023
The parts of REAL and DOUBLE PRECISION numbers are as follows:
* a one-bit sign bit designated by "S" in diagrams above. The sign
bit is a 1 only if the number is negative.
* a biased exponent. The exponent is eight bits for a REAL number,
and 11 bits for a DOUBLE PRECISION number. The values of all zeros,
and all ones, are reserved values for exponents.
* a normalized mantissa, with the high-order 1 bit "hidden." The
mantissa is 23 bits for a REAL number, and is 52 bits for a DOUBLE
PRECISION number. A REAL or DOUBLE PRECISION number is represented
by the form:
exponent-bias
2 x 1.fraction
where fraction is the number of bits in the mantissa.
Examples:
________________________________________
Value Real DOUBLE PRECISION
----------------------------------------
+0 00000000 0000000000000000
-0 80000000 8000000000000000
+1 3f800000 3ff0000000000000
-1 bf800000 bff0000000000000
+2 40000000 4000000000000000
+3 40400000 4008000000000000
+Infinity 7f800000 7ff0000000000000
-Infinity ff800000 fff0000000000000
NaN 7f8xxxxx 7ffxxxxxxxxxxxxx
----------------------------------------
I hope this is of some help.
--
Brent L. Bates
NASA-Langley Research Center
M.S. 294
Hampton, Virginia 23665-5225
(804) 864-2854
E-mail: blbates at aero4.larc.nasa.gov or blbates at aero2.larc.nasa.gov
More information about the Comp.sys.sgi
mailing list