Comparing 2 float nombers
Afficher commentaires plus anciens
Hello I've some problem for comparing float nombers... a=123.123;
b=a-123;
b==0.123;
ans =
logical
0
...and whats the problem???
Tanx again...
Réponses (2)
KALYAN ACHARJYA
le 4 Mai 2019
Modifié(e) : KALYAN ACHARJYA
le 4 Mai 2019
>> format long
>> a=123.123
a =
1.231230000000000e+02
>> b=a-123
b =
0.123000000000005
>> b==0.1230
ans =
0
Image Analyst
le 4 Mai 2019
0 votes
Try the function ismembertol().
See more discussion of your FAQ in the FAQ document: The MATLAB FAQ
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!