Relational operator == doesn't work properly in some cases!
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
When I run this code:
1.1-1==0.1
I recieve this:
ans =
logical
0
I think it's not rational. Could somebody explain why I'm getting that result?
0 Commenti
Risposta accettata
Star Strider
il 15 Gen 2020
You are seeing the effects of floating-point approximation error.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!