10^(10^10) is a 1 followed by ten
billion zeros. Naively evaluating that to an integer is going to
cause time and memory problems in any software that supports
arbitrary size integers - as Bob Ippolito said, it's going to take
about 3.86gb just to store such a number in binary. Even math
software (Maple) rejects an attempt to evaluate it directly -
sensibly, the "arbitrary size" integers in Maple do have a
maximum.
h> import Data.Number.BigFloat
h> ((10 :: BigFloat Eps1)^10)^10
1.e100
and
If you are only solving 10^(10^10) why not
construct a string with "1" followed by a 100 zeroes?
10^(10^10) isn't the same as (10^10)^10, which is a 1 followed by
100 zeros, easy to evaluate to an integer in Haskell.
Evaluating (10 :: BigFloat Eps1)^(10^10) runs into the same
problems as 10^(10^10):
Prelude> 10^(10^10)
<interactive>: out of memory
[restart]
Prelude> 10.0^(10^10)
Infinity
Prelude> 10.0**(10.0^10)
Infinity
Prelude> import Data.Number.BigFloat
Prelude Data.Number.BigFloat> (10 :: BigFloat Eps1)^(10^10)
<interactive>: out of memory
Maple> 10.0^(10^10);

Maple> 10^(10^10);
Error, operation failed. Integer exponent too large.
Graham
On 21/09/2013 10:02 PM, yi lu wrote: