Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!sun-barr!lll-winken!decwrl!ucbvax!AERO4.LARC.NASA.GOV!blbates From: blbates@AERO4.LARC.NASA.GOV ("Brent L. Bates AAD/TAB MS294 x42854") Newsgroups: comp.sys.sgi Subject: Re: Binary representation of REAL #'s VAX vs.IRIS Message-ID: <9001051635.AA14023@aero4.larc.nasa.gov> Date: 5 Jan 90 13:35:59 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 71 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@aero4.larc.nasa.gov or blbates@aero2.larc.nasa.gov