Effacer les filtres
Effacer les filtres

Issue when using ceil function

2 vues (au cours des 30 derniers jours)
Silvester
Silvester le 9 Fév 2023
Hello,
I am new to Matlab. I noticed a difference when using the ceil function:
a = ceil(511*5e-6*8e5);
b = ceil(511*5*0.8);
May I know the reason why I got different results for a and b?

Réponse acceptée

Tushar Behera
Tushar Behera le 9 Fév 2023
Hi Silvester,
The results for a and b are different because the expressions for each of them are different. The issue is not with MATLAB but it is due to how the data for floating point numbers are stored in a computer.
For a better understanding please refer to this MATLAB Answer,
I hope this helps you.
Regards,
Tushar

Plus de réponses (1)

Image Analyst
Image Analyst le 9 Fév 2023

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by