How can i use the ceil function rightly?

1 vue (au cours des 30 derniers jours)
Chau Phong
Chau Phong le 24 Août 2019
Commenté : Chau Phong le 26 Août 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

Réponse acceptée

Walter Roberson
Walter Roberson le 24 Août 2019
>> 2.7/0.3 - 9
ans =
1.77635683940025e-15
so ceil() is correct.
  1 commentaire
Chau Phong
Chau Phong le 26 Août 2019
Thank you so much,i get it now

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by