1
$\begingroup$

Consider an architecture or programming language that uses $n$ bits for storing a floating point number in a particular format. Then each and every floating point number it can store should be in a given range, say $[lf, uf]$.

If there is a need to store any floating point number less than $lf$ then we generally treat such phenomenon as underflow. Consider the following from Numerical Computation chapter of Deep Learning book.

One form of rounding error that is particularly devastating is underflow . Underflow occurs when numbers near zero are rounded to zero. Many functions behave qualitatively differently when their argument is zero rather than a small positive number. For example, we usually want to avoid division by zero (some software environments will raise exceptions when this occurs, others will return a result with a placeholder not-a-number value) or taking the logarithm of zero (this is usually treated as $-\infty$, which then becomes not-a-number if it is used for many further arithmetic operations).

You can observe that two examples has been given while explaining underflow: division by zero and logarithm of zero. If we treat mathematically, both are undefined. It should not be an issue of storage, especially underflow.

Is there any reason behind proving such examples, which are mathematically undefined, under the umbrella term underflow and using the term "not-a-number"?

$\endgroup$
1
  • 1
    $\begingroup$ Great question! I'm a discrete guy, so I try to avoid floats, and am looking forward to an accepted answer. (I noted recently how trivial any standard precision becomes for things like fractals:) Excellent link—useful. $\endgroup$
    – DukeZhou
    Aug 30, 2021 at 3:46

2 Answers 2

1
$\begingroup$

Yes, they can be related to underflow. Mathematically, we do not expect facing with division by zero when we have an expression $\frac{1}{\varepsilon}$ when $\varepsilon > 0$. However, in numerical softwares, it can happen if $\varepsilon < lf$.

Moreover, you can think about the same scenario for taking the logarithm of zero.

$\endgroup$
0
$\begingroup$

According to IEEE Standard, a processor must set exception flags if any of the following conditions arise when performing operations: underflow, overflow, divide by zero, inexact, invalid. Therefore, there is a special numeric binary representation for these conditions which is defined as the value NaN in IEEE single-precision and double-precision format.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .