- the first-ever thread on the Answers forum that addresses this question
- a nice FAQ that includes an answer to this
- a "Cleve's Corner" article that talks about the limitations of floating point
Matlab floating point errors
조회 수: 23 (최근 30일)
이전 댓글 표시
Hello all. I am using a Matlab R2011b version, but I am experiencing some problems in floating point calculation. For instance, if I have a = 10; b = 1e-5; a / b is not 1e6 as expected, but 9.999...*1e5. I think it is due to a floating point error or something like that. But it is very strange to have it in the fifth or sixth decimal position. Is anyone experiencing the same problems? Is it an issue related to the version? How could I solve it?
Thanks a lot Matteo
댓글 수: 0
채택된 답변
the cyclist
2012년 6월 23일
Varients of this question come up a lot. For example, it was recently discussed in this thread:
That thread has links to several resources that answer this question, including
and well as some nice comments, within the thread itself, about the difference between decimal and binary representation.
I would note that in your example, the discrepancy is not in the 5th or 6th decimal place. It is in something more like the 15th or 16th.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!