Relational operator == doesn't work properly in some cases!
6 ビュー (過去 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?
0 件のコメント
採用された回答
Star Strider
2020 年 1 月 15 日
You are seeing the effects of floating-point approximation error.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!