フィルターのクリア

Matlab returns Inf for 10^1000.

11 ビュー (過去 30 日間)
David
David 2013 年 10 月 10 日
回答済み: John D'Errico 2013 年 10 月 10 日
Why is 10^1000 unrepresentable in Matlab?

採用された回答

Walter Roberson
Walter Roberson 2013 年 10 月 10 日
MATLAB uses IEEE 754 Double Precision Floating Point. The maximum representable value is approximately 1E+308
The File Exchange has an extended precision integer tool.
The Symbolic Toolbox represents values with potentially longer precision. I am not certain what the limit is; 10^10000 possibly, maybe higher.
  2 件のコメント
David
David 2013 年 10 月 10 日
Is there a formula for calculating the largest storable value by a n bit long string? Like, for single it's 2^31 - 1. Or, have I been misinformed?
Roger Stafford
Roger Stafford 2013 年 10 月 10 日
編集済み: Roger Stafford 2013 年 10 月 10 日
In IEEE 754 double precision floating point numbers the largest possible finite number representable is 2^1024*(1-2*(-53)) and is called 'realmax'. The total bit string which represents these numbers is 64 bits long with one bit for the sign, 11 bits for the exponent, and 53 bits, one of which is implicit ("hidden"), for the significand (mantissa).
(Corrected)

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

その他の回答 (2 件)

John D'Errico
John D'Errico 2013 年 10 月 10 日
As Per and Roger have explained, the issue is that a double only goes so far. Floating point numbers use a fixed number of bits to encode any number within reasonable limits. However, some numbers are just too big. For them, you need a tool in matlab that is designed to handle them. Thus
sym('10^1000')
ans =
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
My HPF can do it too.
hpf('1e1000',100)
ans =
1.e1000
As well as my vpi tool, or the enhanced version of that tool, vpij.
vpi(10)^1000
ans =
10000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000
So MATLAB CAN represent that number, but only if you use the proper data type.

per isakson
per isakson 2013 年 10 月 10 日
編集済み: per isakson 2013 年 10 月 10 日
Because
>> realmax( 'double' )
ans =
1.7977e+308

カテゴリ

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