当进制 ≥ 2 时,实数可表示为:
其值为
123.145 = 1.23145 × 10^2
= 1.23145E2
1.23145 mantissa
E2 exponent
Attention: mantissa cannot start with 0, if it is 0, the number is not normalised.
Therefore, in binary, the mantissa can only be 1, so we can ignore it. So we just need 23 bits to store mantissa.
We only need to store:
[31][23-30][0-22]
S E M
Bit No | Size | Field Name |
---|---|---|
31 | 1 bit | Sign (S) |
23-30 | 8 bits | Exponent (E) |
0-22 | 23 bits | Mantissa (M) |
${(1/5)}{10} = (0.001100110011...){2} = (1.1001100E-3)_{2}$
In a fixed exponent n
, we have:
- Min:
$1.000 ... 00 E n$ - Max:
$1.111 ... 11 E n$
So we have
对于当
范围为
数集 | 样例 | 运算 | 代数系统 |
---|---|---|---|
0, 1, 2, ... | +, × | ||
-2, -1, 0, 1, 2, ... | +, ×, - | Ring | |
a/b | +, ×, -, ÷ | Field | |
3.14159... | +, ×, -, ÷ | Field |
- Computer integers behave like
$\Z_{2^{32}}$ is not a field. - There are other field,
$\Z_m$ ,$m$ is prime. - Floating point numbers do not form a field.
- "Floating Point Numbers": https://www.doc.ic.ac.uk/~eedwards/compsys/float/