- 论坛徽章:
- 0
|
In all other cases, let s, e, and m be three values that can be computed from the argument:
int s = ((bits >> 31) == 0) ? 1 : -1;
int e = ((bits >> 23) & 0xff);
int m = (e == 0) ?
(bits & 0x7fffff) << 1 :
(bits & 0x7fffff) | 0x800000;
Then the floating-point result equals the value of the mathematical expression s·m·2e-150.
为什么e==0时,是 (bits & 0x7fffff) << 1而不是 (bits & 0x7fffff) | 0x800000;
我在维基百科上查到的IEEE754-1985(http://en.wikipedia.org/wiki/IEEE_754-1985)格式转换后只有 (bits & 0x7fffff) | 0x800000。 |
|