IEEE 754中表示的最大浮点数 [英] max float represented in IEEE 754

查看:830
本文介绍了IEEE 754中表示的最大浮点数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道IEEE 754中表示的最大浮点数是:


$(b)(1.11111111111111111111111)_b * 2 ^ [(11111111)_b- 127]



这里 _b 表示二进制表示。但是这个值是 3.403201383 * 10 ^ 38 ,它与 3.402823669 * 10 ^ 38 不同,它是(1.0)_b * 2 ^ [(11111111)_b-127] ,例如 c ++ <限定> 。是不是
(1.11111111111111111111111)_b * 2 ^ [(11111111)_b-127] 在框架中可表示和更大?

有人知道为什么吗?


解决方案指数11111111 b 是为infinities和NaNs保留的,所以你的号码不能被表示。



最大值以单精度表示,约为3.4028235×1038,实际上是1.11111111111111111111111_b2×11111110_b -127 。



另请参阅 http:/ /en.wikipedia.org/wiki/Single-precision_floating-point_format


I am wondering if the max float represented in IEEE 754 is:

(1.11111111111111111111111)_b*2^[(11111111)_b-127]

Here _b means binary representation. But that value is 3.403201383*10^38, which is different from 3.402823669*10^38, which is (1.0)_b*2^[(11111111)_b-127] and given by for example c++ <limits>. Isn't (1.11111111111111111111111)_b*2^[(11111111)_b-127] representable and larger in the framework?

Does anybody know why?

Thank you.

解决方案

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

这篇关于IEEE 754中表示的最大浮点数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆