Is it 52 or 53 bits of floating point precision?

前端 未结 3 659
自闭症患者
自闭症患者 2021-01-06 13:14

I keep on seeing this nonsense about 53 bits of precision in 64-bit IEEE floating point representation. Would someone please explain to me how in the world a bit that is st

3条回答
  •  感动是毒
    2021-01-06 13:43

    The mathematical significand1 of an IEEE-754 64-bit binary floating-point object has 53 bits. It is encoded with the combination of a 52-bit field exclusively for the significand and some information from the exponent field that indicates whether the 53rd bit is 0 or 1.

    Since the main significand field is 52 bits, some people refer to the significand as 52 bits, but this is sloppy terminology. The significand field does not contain all the information about the significand, and the complete significand is 53 bits.

    It is not true that the leading bit of the significand is never used (as anything other than 1). When the encoding of the exponent is zero, the leading bit of the significand is 0 instead of the more frequent 1.


    1 “Significand” is the preferred term, not “mantissa.” A significand is linear, a mantissa is logarithmic.

提交回复
热议问题