Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I've noticed that import changes numbers slightly. For example, 0.417 becomes 0.416999999999. What is causing this to happen?

1 回表示 (過去 30 日間)
Eric S
Eric S 2016 年 1 月 14 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I've noticed that import changes numbers slightly. For example, 0.417 becomes 0.416999999999. What is causing this to happen?
  1 件のコメント
John D'Errico
John D'Errico 2016 年 1 月 14 日
編集済み: John D'Errico 2016 年 1 月 14 日
0.417 is a number that does not exist in a BINARY floating point form, so it is stored as
0.4169999999999999817923423961474327370524406433105468750

回答 (1 件)

Star Strider
Star Strider 2016 年 1 月 14 日
You’re seeing floating-point approximation error.

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by