Numerical Analysis Questions & Answers | |
|
|
|
|
Well because for the same exponent (the smallest possible one), 0.f will be just below 1.f. 1 point bonus boost.
|
|
|
|
On gcc on x86 Linux, the smallest number for a signed 1-byte integer will be -128 and the largest number will be +127 (this can be easily tested). As I mentioned in class, this is due to the negative zero being used for an extra negative number. I couldn't find a reference thus on whether this is a strict standard for C. I also couldn't find a reference on how gcc does the arithmetic, hence why I mentioned in class there are several ways the compiler could achieve this. As you mention, one way this could be done is with “two's complement” [l]. Then the bits will look this way:
|
|
|
|
This was explained in class.
|
|
|
|
This should be obvious. The exponent is $p=e-b$ where $b$ is a constant that is used to split the possible exponents equally between positive and negative values (the exponent $p$ is either negative or positive while the biased exponent $e$ is all positive).
|
|
|
|
But $e=0$ indicates a special case, not an exponent. Thus, the minimum exponent $p_{\rm min}$ is not calculated using $e=0$ but using $e=1$.
|
|
||
$\pi$ |