According to a quick interactive session and the timeit module it's quicker to do 2.71828**10 than using math.exp, I'm guessing cos of the function call. >>> t=timeit.Timer("2.718282**10") >>> t.repeat() [0.073765993118286133, 0.066617012023925781, 0.06807398796081543]
>>> t=timeit.Timer("math.exp(10)", "import math") >>> t.repeat() [0.42525100708007812, 0.43169903755187988, 0.4239799976348877] >>> t=timeit.Timer("exp(10)", "from math import exp") >>> t.repeat() [0.36061406135559082, 0.36182284355163574, 0.35887718200683594] 2009/1/13 culpritNr1 <ig2ar-s...@yahoo.co.uk> > > Thanks Marc and Kent and all. math.exp() is what I was looking for. > > culpritNr1 > > > -- > View this message in context: > http://www.nabble.com/power-of-2.718282-tp21441385p21441787.html > Sent from the Python - tutor mailing list archive at Nabble.com. > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor >
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor