Path: utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!agate!apple!motcsd!hpda!hpcupt1!hpisod2!decot From: decot@hpisod2.HP.COM (Dave Decot) Newsgroups: comp.org.ieee Subject: Re: IEEE Standard for Floating Point Message-ID: <20120002@hpisod2.HP.COM> Date: 8 Oct 89 00:44:05 GMT References: <1861@jato.Jpl.Nasa.Gov> Organization: Hewlett Packard, Cupertino Lines: 59 IEEE Standard for Binary Floating-Point Arithmetic, ANSI/IEEE Std 754-1985. To quote from a draft version (presumably the same as the final version): Numbers in the single and double formats are composed of three fields: A 1-bit sign s. A biased exponent e = E + bias A fraction f = .b b ....b 1 2 p-1 ... A 32-bit single format number X is divided as shown in Figure 1. The value v of X is inferred from its constituent fields thus: (1) If e = 255 and f != 0, then v is NaN [not-a-number] regardless of s. (2) If e = 255 and f = 0, then v = (-1)^s * infinity. (3) If 0 < e < 255, then v = (-1)^s * 2^(e-127) * (1.f). (4) If e = 0 and f != 0, then v = (-1)^s * 2^(-126) * (0.f) (denormalized numbers). (5) If e = 0 and f = 0, then v = (-1)^s * 0 (zero). Figure 1. Single Format 1 8 23 ...widths +-+--------+----------------+ |s| e | f | +-+--------+----------------+ msb lsb msb lsb ...order "msb" means "most significant bit" "lsb" means "least significant bit" ... A 64-bit double format number X is divided as shown in Figure 2. The value v of X is inferred from its constituent fields thus: (1) If e = 2047 and f != 0, then v is NaN [not-a-number] regardless of s. (2) If e = 2047 and f = 0, then v = (-1)^s * infinity. (3) If 0 < e < 2047, then v = (-1)^s * 2^(e-1023) * (1.f). (4) If e = 0 and f != 0, then v = (-1)^s * 2^(-1022) * (0.f) (denormalized numbers). (5) If e = 0 and f = 0, then v = (-1)^s * 0 (zero). Figure 2. Double Format 1 11 52 ...widths +-+--------+----------------+ |s| e | f | +-+--------+----------------+ msb lsb msb lsb ...order (I've used "^" to signify exponentiation and "*" to signify multiplication) Hope this helps!