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?

 채택된 답변

Star Strider
Star Strider 2021년 4월 29일

1 개 추천

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

댓글 수: 2

Wang Zhongwei
Wang Zhongwei 2021년 4월 29일
thank you!The answer is useful!
Star Strider
Star Strider 2021년 4월 29일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2021년 4월 29일

댓글:

2021년 4월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by