2**HUGENUMBER Why not optimise it?

Christopher A. Craig com-nospam at ccraig.org
Wed May 22 21:39:50 EDT 2002


"Mike C. Fletcher" <mcfletch at rogers.com> writes:

> really huge exponents.  Python obviously optimises 1**x (since 1**1000000
> returns instantly), so why not 2**x where x > (30 or 62)?

Obviously?  It actually doesn't optimize it at all, it's just that you
can calculate 1*1 a lot faster than (2**99999999)*2

-- 
Christopher A. Craig <com-nospam at ccraig.org>
"No one has ever called us untrustworthy" -- Steve Balmer





More information about the Python-list mailing list