八精度浮点数

来自GSXAB的知识库
八精度浮点数
术语名称 八精度浮点数
英语名称 octuple-precision floating-point type
别名 octuple-precision floating-point format, 八精度浮点型, float256, binary256, 256位浮点数, 256-bit floating-point format

八精度浮点数/八精度浮点型(octuple-precision floating-point number)是浮点型中长 256 二进制位数据类型,符合 IEEE 754-2008 中 binary256 类型的格式,以及 IEEE 754-2019 中对于 128 位以上且是 32 整数倍的二进制类型的通用格式。根据长度,称为 float256 或 binary256 。

八精度浮点数范围已经大大超过当前绝大多数物理可观测数据的取值范围,且基本没有硬件支持、一般通过任意精度浮点算术软件实现,一般只出现在实验室场景中。在实践中,八精度很少有使用。

定义

八精度浮点数(octuple-precision floating-point type)或 float256FP256binary256 ,指长度为 256 位、符合 IEEE 754 中 binary256 类型浮点格式的浮点类型。

其中浮点数的 256 位包括符号位 1 位、阶码 19 位、尾数 236 位。

floating_point_binary256.svg

范围

阶码 19 位,因此阶码偏移量为 [math]\displaystyle{ b=2^{19-1}-1=262143 }[/math] 。指数范围 [math]\displaystyle{ e_\min = 1-b=-262142, e_\max=b=262143 }[/math] 。 尾数 236 位,精度 [math]\displaystyle{ p=237 }[/math] ,因此尾数精度为 [math]\displaystyle{ 2^{-236} }[/math] ,尾数取值在 0 ~ [math]\displaystyle{ 1-2^{-236} }[/math] 之间。

其有效数精度为 237 位二进制数(含隐藏位),相当于约 71 位十进制数的有效数字([math]\displaystyle{ \lg 2^{113} \approx 71.34 }[/math])。

对四精度浮点数,除了 0 和无穷、 NaN 外:

  • 规格化数 [math]\displaystyle{ (-1)^s 2^{E-262143} (1+M) }[/math] 正数绝对值范围:[math]\displaystyle{ 2^{-262142} \approx 2.482 \times 10^{-78913} }[/math][math]\displaystyle{ 2^{262163} \times (2 - 2^{-236}) \approx 1.611 \times 10^{78913} }[/math]
  • 非规格化数 [math]\displaystyle{ (-1)^s 2^{e_\min} M }[/math] 正数绝对值范围:[math]\displaystyle{ 2^{-262142} \times 2^{-236} \approx 2.248 \times 10^{-78984} }[/math][math]\displaystyle{ 2^{-262143} \times (1 - 2^{-236}) \approx 2.482 \times 10^{-78913} }[/math]