Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!apple!amdcad!crackle!tim From: tim@crackle.amd.com (Tim Olson) Newsgroups: comp.arch Subject: Re: IEEE 754 vs. 854 (floating-point arithmetic) Message-ID: <25745@amdcad.AMD.COM> Date: 24 May 89 16:06:27 GMT References: <18721@cup.portal.com> Sender: news@amdcad.AMD.COM Reply-To: tim@amd.com (Tim Olson) Organization: Advanced Micro Devices, Inc. Sunnyvale CA Lines: 53 Summary: Expires: Sender: Followup-To: In article <18721@cup.portal.com> mmm@cup.portal.com (Mark Robert Thorson) writes: | As near as I can tell, the only difference between 754 and 854 is the | treatment of massive overflow and underflow. No, the 854 standard is the radix-independent version of the 754 standard. | IEEE arithmetic uses a format in which the exponent is biased (e.g. an | exponent of 1 with a bias of 8192 is expressed as 8193). Except that (under 754) the biases are +127 for single-precision and +1023 for double-precision. | When a result exceeds the range of the exponent, a larger bias is used, | and a special code is used to indicate that a "denormalized" result has | been generated. Things seem to be a bit confused, here. Denormalized numbers are numbers that are smaller (in magnitude) than those that can normally be represented by the standard biased exponent. Their representation is an exponent (biased) of 0 with a non-zero fraction. This allows "gradual underflow" instead of "sudden underflow", but does result in a loss of precision. You may be thinking of the specification for trapped operation on overflow, which requires that the implementation deliver to the trap handler the result "obtained by dividing the infinitely precise result by 2**_a_ and then rounding. The bias adjust _a_ is 192 in the single, 1536 in the double...". Underflow is the same, except that the number is obtained by multiplying by 2**_a_. | If a result exceeds the number range which can be represented by denormalized | numbers, the condition known as "massive overflow" or "massive underflow" | occurs. | | Under IEEE standard 754, this condition is indicated by a quiet NaN. | (A NaN is a representation for "not a number"; i.e. an error condition.) Not so. The standard says that non-trapped overflow returns either the infinity of the correct sign, or the format's most negative or positive number, depending upon the rounding mode in effect. Non-trapped underflow returns either 0, a denormalized number, or the format's most smallest negative or positive number, depending upon the rounding mode in effect. | Under its successor, IEEE standard 854, you have the option of returning a | quiet NaN, or +/- infinity or zero. No -- same as above. -- Tim Olson Advanced Micro Devices (tim@amd.com)