Could anyone tell me what is wrong with the following code?
1 回表示 (過去 30 日間)
古いコメントを表示
>> a=(6.6-5.5)/0.1
a =
11.0000
>> floor(a)
ans =
10
I suppose I should get ans=11, right? But I got ans=11. If I run the following code, I got the right result
>> a=(2.2-1.1)/0.1
a =
11
>> floor(a)
ans =
11
Could anyone tell me what is wrong with the first part?
0 件のコメント
採用された回答
madhan ravi
2020 年 6 月 29 日
編集済み: madhan ravi
2020 年 6 月 29 日
sprintf('%.32f',(6.6-5.5)/0.1)
(6.6-5.5)/sym(0.1)
その他の回答 (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!