language-icon Old Web
English
Sign In

Arithmetic underflow

The term arithmetic underflow (or 'floating point underflow', or just 'underflow') is a condition in a computer program where the result of a calculation is a number of smaller absolute value than the computer can actually represent in memory on its CPU. The term arithmetic underflow (or 'floating point underflow', or just 'underflow') is a condition in a computer program where the result of a calculation is a number of smaller absolute value than the computer can actually represent in memory on its CPU. Arithmetic underflow can occur when the true result of a floating point operation is smaller in magnitude (that is, closer to zero) than the smallest value representable as a normal floating point number in the target datatype. Underflow can in part be regarded as negative overflow of the exponent of the floating point value.For example, if the exponent part can represent values from −128 to 127, then a result with a value less than −128 may cause underflow. Note that storing values that are too low in an integer variable (e.g. attempting to store -1 in an unsigned integer) is properly referred to as integer overflow, or more broadly 'integer wraparound'. The term underflow normally refers to floating point numbers only, and is a separate issue. It is not possible in most floating-point designs to store a too-low value, as usually they are signed and have a negative infinity value. The interval between −fminN and fminN, wherefminN is the smallest positive normal floating point value, is called the underflow gap.This is because the size of this interval is many orders of magnitude larger than the distance betweenadjacent normal floating point values just outside the gap. For instance, if the floatingpoint datatype can represent 20 binary digits, the underflow gap is 221 timeslarger than the absolute distance between adjacent floating point values just outside the gap. In older designs, the underflow gap had just one usable value, zero. When an underflow occurred,the true result was replaced by zero (either directly by the hardware, or by system softwarehandling the primary underflow condition). This replacement is called flush to zero. The 1984 edition of IEEE 754 introduced subnormal numbers. The subnormal numbers (including zero) fill theunderflow gap with values where the absolute distance between adjacent values is the same asfor adjacent values just outside the underflow gap. This enables gradual underflow wherea nearest subnormal value is used, just as a nearest normal value is used when possible.Even when using gradual underflow, the nearest value may be zero. The absolute distance between adjacent floating point values just outside the gap is called the machine epsilon. The machine epsilon is typically characterized by the largest value whose sum with the value 1 will result in the answer with value 1 in that floating point scheme. This can be written as f l ( 1 + ϵ ) = 1 {displaystyle fl(1+epsilon )=1} , where f l ( ) {displaystyle fl()} is a function which converts the real value into the floating point representation. While the machine epsilon is not to be confused with the underflow level (assuming subnormal numbers), it is closely related. The machine epsilon is dependent on the number of bits which make up the significand, whereas the underflow level depends on the number of digits which make up the exponent field. In most floating point systems, the underflow level is smaller than the machine epsilon.

[ "Real-time computing", "Operating system", "Programming language" ]
Parent Topic
Child Topic
    No Parent Topic