双浮点运算计算机在线,计算机浮点数系统 - 奋斗吧,骚年 - OSCHINA - 中文开源技术交流社区...

浮点数在计算机内的存储是怎样的呢?以双精度浮点数为例来说吧:

Most nonzero floating-point numbers are normalized. This means they can be   expressed as :         x = ±(1 + f) *2^e

Double-precision floating-point numbers are stored in a 64-bit word, with 52bits for f, 11 bits for e, and 1 bit for the sign of the number. The number 1 was not actually stored for its default property . In effect, the IEEE format packs 65 bits of information into a 64-bit word.

这就是双精度浮点(double)型数据,占8 个字节(64位)内存空间。但是其数值范围为1.7E-308~1.7E+308,双精度完全保证的有效数字是15位,也就是那对应f的52位的二进制数所能表示的f的十进制数的范围。

eps is the distance from 1 to the next larger floating-point number. For IEEE double-precision, eps = 2^(-52).即是f的最小值。The approximate decimal value of eps is 2.2204·10 −16.

In either case, you can say that the roundoff level is about 16 decimal digits.16位只是部分数值的精确度有保证。

关于小数0.1的存储细节,可以参考这篇博客。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值