Relational operator == doesn't work properly in some cases!
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Masood
el 15 de En. de 2020
Respondida: Star Strider
el 15 de En. de 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 comentarios
Respuesta aceptada
Star Strider
el 15 de En. de 2020
You are seeing the effects of floating-point approximation error.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!