2**2**2**2**2 wrong? Bug?
Paul McGuire
ptmcg at austin.rr.com
Tue Jul 10 06:42:39 CEST 2007
On Jul 9, 11:21 pm, "Jim Langston" <tazmas... at rocketmail.com> wrote:
> In Python 2.5 on intel, the statement
> 2**2**2**2**2
> evaluates to>>> 2**2**2**2**2
>
> 20035299304068464649790723515602557504478254755697514192650169737108940595563114
> 53089506130880933348101038234342907263181822949382118812668869506364761547029165
> 04187191635158796634721944293092798208430910485599057015931895963952486337236720
<snip>
Exponentiation is right associative, so this is the same as:
2**(2**(2**(2**2)))
2**2**2**4
2**2**16
2**65536
2=10**0.3010, so 2**65536 is approx 10**19726
There are 19730 digits in your answer, so this seems to be at least in
the ball park.
-- Paul
More information about the Python-list
mailing list