Relational operator == doesn't work properly in some cases!

7 次查看(过去 30 天)
When I run this code:
1.1-1==0.1
I recieve this:
ans =
logical
0
I think it's not rational. Could somebody explain why I'm getting that result?

采纳的回答

Star Strider
Star Strider 2020-1-15
You are seeing the effects of floating-point approximation error.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by