What is the range of datatype double in Matlab ?

18 ビュー (過去 30 日間)
Ajay Pherwani
Ajay Pherwani 2013 年 8 月 21 日
If we assign any value to a variable , Matlab assigns its data type as double .
What is the max range of that variable ?

採用された回答

David Sanchez
David Sanchez 2013 年 8 月 21 日
All numerical variables in MATLAB are stored as 32 bit floating point numbers. This corresponds to double precision on most computers. I think it can range from -1.7976931348623158e+308 to -2.2250738585072014e-308, or from 2.2250738585072014e-308 to 1.7976931348623158e+308.
  2 件のコメント
Laurent
Laurent 2013 年 8 月 21 日
This range is correct, although a double requires 64 bits to store its value.
James Tursa
James Tursa 2013 年 8 月 21 日
編集済み: James Tursa 2013 年 8 月 21 日
To clarify the lower range, numbers between these two number ranges are "de-normalized" or "sub-normal", meaning they have less precision (using fewer actual mantissa bits) than a regular double.
>> typecast(uint64(1),'double')
ans =
4.940656458412465e-324
>> realmin
ans =
2.225073858507201e-308
Whereas numbers between these two ranges have full precision (use all available mantissa bits):
>> realmin
ans =
2.225073858507201e-308
>> realmax
ans =
1.797693134862316e+308
Similar for negative numbers.

サインインしてコメントする。

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