MATLAB and rounding

Hi! I'm a novice in MATLAB. I have a simple problem:
> x=9.459012348 > y=9.459012347
> x-y
ans =
1.000000082740371e-009
Hmmm... Why I get that "...82740371"? Thank you very much.

답변 (2개)

Oleg Komarov
Oleg Komarov 2011년 7월 2일

1 개 추천

x-y cannot be represented exactly in binary form, thus it approximates the result.
Carlo Cavaliere
Carlo Cavaliere 2011년 7월 2일

0 개 추천

Thank you. Now it's all clearer.
But I'm still not able to figure how EPS is involved :\

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

질문:

2011년 7월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by