在线咨询 切换到宽版
eetop公众号 创芯大讲堂 创芯人才网

 找回密码
 注册

手机号码,快捷登录

手机号码,快捷登录

搜帖子
查看: 2147|回复: 5

matlab计算误差问题提问

[复制链接]
发表于 2021-7-10 16:46:43 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
image.png 麻烦问一下,使用matlab进行数值计算时,为什么会出现这样的误差,如何解释?

发表于 2021-7-10 17:05:52 | 显示全部楼层
这是浮点数的舍入误差很正常的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-7-10 17:14:02 | 显示全部楼层


   
quantus 发表于 2021-7-10 17:05
这是浮点数的舍入误差很正常的


多问一下,这种误差的精度可以提升吗,通过什么方式呢?
回复 支持 反对

使用道具 举报

发表于 2021-7-10 17:15:29 | 显示全部楼层


   
hadd 发表于 2021-7-10 17:14
多问一下,这种误差的精度可以提升吗,通过什么方式呢?


不能提升, 不影响普通的计算, 这是非常常见的问题

回复 支持 反对

使用道具 举报

发表于 2021-7-11 02:24:30 | 显示全部楼层
This a common error to all calculation dealing with double precision IEEE754 representation and not specific to matlab.

As you know the calculation is done internally in binary (base 2) and displayed in base 10. A conversion between base 2 and base 10 is always done. When dealing with fractionnal numbers (>1), the conversion can not be exact and an error will rise. The algorithm has to do a rounding.
In double precision the number of significant digits is 16. So the last digit in your case is incorrect because of the conversion; it is equal to 3 insteed of 0.

I recommand the Following article for further explanation
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html

回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-10-2 11:13:20 | 显示全部楼层


   
osmanali 发表于 2021-7-11 02:24
This a common error to all calculation dealing with double precision IEEE754 representation and not  ...


谢谢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

手机版| 小黑屋| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-7-10 17:15 , Processed in 0.091050 second(s), 8 queries , Gzip On, MemCached On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表