max float represented in IEEE 754

妖精的绣舞 提交于 2019-12-01 04:25:36

The exponent 11111111b is reserved for infinities and NaNs, so your number cannot be represented.

The greatest value that can be represented in single precision, approximately 3.4028235×1038, is actually 1.11111111111111111111111b×211111110b-127.

See also http://en.wikipedia.org/wiki/Single-precision_floating-point_format

Being the "m" the mantisa and the "e" the exponent, the answer is:

In your case, if the number of bits on IEEE 754 are:

  • 16 Bits you have 1 for the sign, 6 for the exponent and 11 for the mantisa. The largest number represented is 4,293,918,720.
  • 32 Bits you have 1 for the sign, 8 for the exponent and 23 for the mantisa. The largest number represented is 3.402823466E38
  • 64 Bits you have 1 for the sign, 11 for the exponent and 52 for the mantisa. The largest number represented is 2^1024 - 2^971
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!