MATLAB Answers

How can i use the ceil function rightly?

5 views (last 30 days)
Chau Phong
Chau Phong on 24 Aug 2019
Commented: Chau Phong on 26 Aug 2019
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 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 24 Aug 2019
>> 2.7/0.3 - 9
ans =
1.77635683940025e-15
so ceil() is correct.

  1 Comment

Chau Phong
Chau Phong on 26 Aug 2019
Thank you so much,i get it now

Sign in to comment.

More Answers (0)

Tags


Translated by