Small amount of value change in a floating value assignment

3 ビュー (過去 30 日間)
Xinpeng Du
Xinpeng Du 2020 年 5 月 2 日
回答済み: KSSV 2020 年 5 月 2 日
I found if a floating value is assigned to a variable, sometimes the value will experince a small abount change, as seen below. Why is it like that?

採用された回答

KSSV
KSSV 2020 年 5 月 2 日
Floating point numbers are represented in computer in a binary base i.e. in base 2. Most of the times the floating point numbers one enters are exactly not represented in binary and they are approximated to the closest values. You need to read about IEEE 754 floating point number representation to know more. You may read the below link to have some idea.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by