How can i use the ceil function rightly?
13 ビュー (過去 30 日間)
古いコメントを表示
i notice that the ceil function does not work right on some value and i do not know why
for example:i used ceil(2.7/0.3) and it results 10 but the right result must be 9
However,when i tried another value,e.g ceil(2.4/0.3),it results 8 which is right
this function also work wrong on some another values,like ceil(2.1/0.3),ceil (4.2/0.3)
Thank you
0 件のコメント
採用された回答
Walter Roberson
2019 年 8 月 24 日
>> 2.7/0.3 - 9
ans =
1.77635683940025e-15
so ceil() is correct.
As to why 2.7/0.3 is not exactly 9, see http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Robust Control Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!