Relational operator == doesn't work properly in some cases!
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Masood
am 15 Jan. 2020
Beantwortet: Star Strider
am 15 Jan. 2020
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 Kommentare
Akzeptierte Antwort
Star Strider
am 15 Jan. 2020
You are seeing the effects of floating-point approximation error.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!