if you run the following code,you will find the answer is not as you think:
a=0.14*100-14;
then a is not equal to zero,why?

 Respuesta aceptada

Star Strider
Star Strider el 29 de Abr. de 2021

1 voto

Not a bug!
See Floating-Point Numbers for a detailed discussion.

2 comentarios

Wang Zhongwei
Wang Zhongwei el 29 de Abr. de 2021
thank you!The answer is useful!
Star Strider
Star Strider el 29 de Abr. de 2021
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Preguntada:

el 29 de Abr. de 2021

Comentada:

el 29 de Abr. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by