Decimal precision of floats

前端 未结 2 1551
南方客
南方客 2020-12-06 02:08

equivalent to log10(2^24) ≈ 7.225 decimal digits

Wikipedia

Precision: 7 digits

MSDN

2条回答
  •  Happy的楠姐
    2020-12-06 02:34

    It's really only 23 bits in the mantissa (there's an implied 1, so it's effectively 24 bits, but the 1 obviously does not vary). This gives 6.923689900271567 decimal digits of precision, which is not quite 7.

提交回复
热议问题