MATLAB中一个基本运算的BUG?。

m=0.56;
m=m*10;
m=m*10;
m=m-56
执行结果m不为零。奇怪的是当m的小数点为3位或者1位时,执行相应的程序,结果都可以为零,只有当小数位数为2的时候才出错,这会是MATLAB的一个bug还是其它问题?
本人萌新一枚,所用版本为64位R2021a版本。

 Accepted Answer

teekeay
teekeay on 18 May 2023

0 votes

浮点数值导致的精度问题
去看《 这帖(超链接,自己点进去看) 》里面给出的说明和相关链接

More Answers (0)

Asked:

on 18 May 2023

Answered:

on 18 May 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!