why '==' is not working properly, or what do I do wrong?
显示 更早的评论
I just want to know why this happens...

1 个评论
Bob Thompson
2018-11-21
More than likely this is a limitation of the binary. If you expand the number of sigfigs on a(5) and b(100) you will likely find that some small decimal place is slightly different.
回答(1 个)
Jos (10584)
2018-11-21
There is a small difference, as shown by subtraction:
b(100)-a(5)
To tolerate such a small difference between x and y, try this
abs(x-y) < .0001
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!