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 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by