# Why not undefined expression is different from numerical underflow?

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 underﬂow . Underﬂow occurs when numbers near zero are rounded to zero. Many functions behave qualitatively diﬀerently 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"?

• 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. Aug 30, 2021 at 3:46

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$$.