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

 채택된 답변

Walter Roberson
Walter Roberson 2019년 8월 24일

0 개 추천

>> 2.7/0.3 - 9
ans =
1.77635683940025e-15
so ceil() is correct.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

태그

질문:

2019년 8월 24일

댓글:

2019년 8월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by