双 64 位中最小值的位模式是什么

What's the bit pattern for minimal value in double 64 bit

我假设可以放入双浮点数的最小正值是这个

0 0000000000 00000000000000000000000000000000000000000000000000000

科学形式是这样的:

1 x 2^{-1023}

但是,this article 指出:

As mentioned above, zero is not directly representable in the straight format, due to the assumption of a leading 1 (we'd need to specify a true zero mantissa to yield a value of zero). Zero is a special value denoted with an exponent field of all zero bits, and a fraction field of all zero bits.

那么最小正值的模式是什么?

当指数部分全为零时,数字是subnormalsdenormals,其中隐含数字是0而不是1。因此

0 00000000000 0000000000000000000000000000000000000000000000000000

为零,下一个数

0 00000000000 0000000000000000000000000000000000000000000000000001

是最小的正数,等于

0.000000000000000000000000000000000000000000000000000012×2-1022 = 2-1074 大约; 5.0×10-324

更新:为什么指数是 -1022,而偏差是 1023?次正规数与普通浮点数的第一个 binade 具有相同的指数(因此 1-1023 = 1022)。这是为了使传播是连续的,即最大的次正规是

0.11111111111111111111111111111111111111111111111111112×2-1022

和下一个浮点数(最小法线):

1.000000000000000000000000000000000000000000000000000002×2-1022