nth root

ajaksu ajaksu at gmail.com
Sat Jan 31 14:04:54 EST 2009


On Jan 31, 12:03 pm, Mark Dickinson <dicki... at gmail.com> wrote:
[...]
> t1 = timeit.Timer("x = n**power", "n = 4021503534212915433093809093996098953996019232; power = 1./13")
> t2 = timeit.Timer("x = n**power", "n = 4021503534212915433093809093996098953996019232.; power = 1./13")

And by using a float literal instead of "float
(402150353421291543309...)", (BTW, here -^), it not only is faster but
also a great way make some innocent bystander waste his eyesight
trying to figure out the magic trick :D



More information about the Python-list mailing list