TAOCP 4.2.1 Exercise 2
A base $b$, excess $q$, $p$-digit floating point number has the form \pm f\,b^{\,e-q}, where the exponent satisfies
Section 4.2.1: Single-Precision Calculations
Exercise 2. [12] Assume that the exponent $e$ is constrained to lie in the range $0 \le e \le E$; what are the largest and smallest positive values that can be written as base $b$, excess $q$, $p$-digit floating point numbers? What are the largest and smallest positive values that can be written as normalized floating point numbers with these specifications?
Verified: yes
Solve time: 3m18s
Solution
A base $b$, excess $q$, $p$-digit floating point number has the form
$$ \pm f,b^{,e-q}, $$
where the exponent satisfies
$$ 0\le e\le E, $$
and the fraction has $p$ base-$b$ digits,
$$ f=.d_1d_2\cdots d_p =\sum_{k=1}^{p} d_k b^{-k}, \qquad 0\le d_k\le b-1. $$
Hence
$$ 0\le f\le .(b-1)(b-1)\cdots(b-1) =1-b^{-p}. $$
We first consider all floating point numbers, then the normalized ones.
Largest and smallest positive floating point numbers
The largest positive value is obtained by choosing the largest exponent and the largest fraction:
$$ e=E,\qquad f=1-b^{-p}. $$
Therefore
$$ x_{\max} =(1-b^{-p}),b^{E-q}. $$
The smallest positive value is obtained by taking the smallest exponent and the smallest nonzero fraction. The smallest nonzero fraction is
$$ f=.00\cdots01=b^{-p}, $$
and the smallest exponent is $e=0$. Thus
$$ x_{\min} =b^{-p}b^{-q} =b^{-(p+q)}. $$
Therefore the largest and smallest positive floating point numbers are
$$ \boxed{(1-b^{-p}),b^{E-q}} $$
and
$$ \boxed{b^{-(p+q)}}. $$
Largest and smallest positive normalized floating point numbers
A normalized number has either $f=0$ or
$$ f\ge b^{-1}. $$
For positive normalized numbers, the first digit of the fraction must be nonzero. The largest normalized value is obtained exactly as before:
$$ e=E,\qquad f=1-b^{-p}, $$
giving
$$ x_{\max}^{(N)} =(1-b^{-p}),b^{E-q}. $$
For the smallest positive normalized value, the exponent must be as small as possible, namely $e=0$, and the fraction must be the smallest normalized fraction:
$$ f=.100\cdots0=b^{-1}. $$
Hence
$$ x_{\min}^{(N)} =b^{-1}b^{-q} =b^{-(q+1)}. $$
Therefore the largest and smallest positive normalized floating point numbers are
$$ \boxed{(1-b^{-p}),b^{E-q}} $$
and
$$ \boxed{b^{-(q+1)}}. $$
∎