On Tue, Jan 13, 2009 at 1:39 PM, Alan Gauld <alan.ga...@btinternet.com>wrote:

> I would appreciate a low level solution because I have to iteratively call
>> that computation millions of times. Anything more efficient than
>> 2.718182**10 may be good.
>>
>
> Umm, what's wrong with
>
> from math import e  # more precision than 2.718182
> print e**10
>

Apparently nothing at all is wrong with it:
C:\Python25\Lib>python timeit.py -s "import math" "x=math.exp(10)"
1000000 loops, best of 3: 0.678 usec per loop

C:\Python25\Lib>python timeit.py -s "from math import e" "x=e**10"
1000000 loops, best of 3: 0.411 usec per loop



-- 
www.fsrtechnologies.com
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to