JavaScript/双精度浮点数:修订间差异
来自康健生活
| 第187行: | 第187行: | ||
例如单精度结构下 IEEE 754 标准的指数位 E 有 8 位,计算偏移值为 <math>E = e - (2^{{\color{Red}8} - 1} - 1) = e - 127</math>,指数域编码值 e 可表示的值范围为 <math>[0, {\color{Green}2^8 - 1}) = [0, 255)</math>,可计算出阶码 E 的取值范围 <math>(-127, 128)</math> 或者 <math>[-126, 127]</math> 或者 <math>-126 \leq E \leq 127</math>。这里着重注意取值范围的'''开闭区间'''。 | 例如单精度结构下 IEEE 754 标准的指数位 E 有 8 位,计算偏移值为 <math>E = e - (2^{{\color{Red}8} - 1} - 1) = e - 127</math>,指数域编码值 e 可表示的值范围为 <math>[0, {\color{Green}2^8 - 1}) = [0, 255)</math>,可计算出阶码 E 的取值范围 <math>(-127, 128)</math> 或者 <math>[-126, 127]</math> 或者 <math>-126 \leq E \leq 127</math>。这里着重注意取值范围的'''开闭区间'''。 | ||