Is it 52 or 53 bits of floating point precision?

前端 未结 3 649
自闭症患者
自闭症患者 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:41

    It's not stuck. The exponent will move the "stuck" bit around so it's not trapped at a fixed position

    In fact that hidden bit is always the most significant bit after normalization. As it's always set in a normalized value, there's no point saving it explicitly. Leaving it out increases the precision a little bit, which is a good thing

    So instead of 1.xxx...xxx × 2exp we'll store 0.xxx...xxx × 2exp and set the integer part to 1 before operating on it. The hidden bit does affect the result's value instead of just lying there meaninglessly. It's the same as when we normalize a range of decimal values to [0, 1). In that case the integer part is always zero and can be omitted (in some cultures). The freed space can then be used for another digit of precision

提交回复
热议问题