フィルターのクリア

on the meaning of doubles ...

1 回表示 (過去 30 日間)
Seetha Rama Raju Sanapala
Seetha Rama Raju Sanapala 2014 年 7 月 19 日
回答済み: dpb 2014 年 7 月 19 日
I have copy pasted below a piece from MATLAB documentation.
Numbers represented in the double format have a maximum precision of 52 bits. Any double requiring more bits than 52 loses some precision. For example, the following code shows two unequal values to be equal because they are both truncated: x = 36028797018963968; y = 36028797018963972; x == y ans = 1
Integers have available precisions of 8-bit, 16-bit, 32-bit, and 64-bit. Storing the same numbers as 64-bit integers preserves precision: x = uint64(36028797018963968); y = uint64(36028797018963972); x == y ans = 0
My question is this.
>> 2^52
ans =
4503599627370496
If you use double for any numbers greater than 2^52 as above, loss of precision and similar problem like in the documentation should occur. I checked but it does not occur as shown as below. Why?
x =
4503599627370500
y =
4503599627370501
x==y
ans =
0

採用された回答

dpb
dpb 2014 年 7 月 19 日
Actually, IEEE-754 is 53 bit mantissa. For all the gory details see...

その他の回答 (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