R. T. (Fortran Man)
08-22-2003, 06:04 PM
What is a denormalized number?
Lahey Support
08-22-2003, 08:35 PM
To understand denormalized numbers requires an understanding of how floating point numbers are represented on a computer. A floating point number is usually represented with 32, 64, or 128 bits. These bits are divided up into a sign bit, some bits to represent the exponent of the number, and some bits to represent the mantissa, or value of the number. An assumption is made that an additional bit exists for the mantissa, it is the most significant bit, and it is always set to one. Althought this bit is assumed to exist, it is not actually physically present. This lets a floating point number have one bit more of precision than the actual number of bits that are physically present, and this type of floating point number is known as a normalized number.
When a floating point number becomes very small, the assumption that the nonpresent bit is always one breaks down, and the floating point number becomes denormalized. This condition causes a denormalization exception to occur. When the number becomes smaller than the ability of the variable type to represent, it underflows, and by default, is set to zero.
You can test for a denormalized nuumber using the intrinsic function TINY. If a number "x" is less than the quantity TINY(x), it is denormalized.
A denormalized number does not retain the full precision of the data type that contains it. For a 32 bit number, the closer to e-44 that you get, the worse the precision will become. When close to e-44, you might have only 1 bit of precision.
Not all intrinsic functions work properly with denormalized numbers. An example is the SCALE intrinsic. If you have a variable "a", then the expression SCALE(FRACTION(a), EXPONENT(a)) should be equal to "a". If "a" is denormalized, the SCALE function will not return the expected answer.
vBulletin® v3.6.8, Copyright ©2000-2010, Jelsoft Enterprises Ltd.