On 2 mei 2008, at 11:19, Astan Chee wrote:

Hi,
Im not sure if this is more of a math question or a python question. I have a variable in python:
>>> v = 10.0**n
is there a way to find the value of n if i know only v aside from str(v).split('+')[1] ? that seems like too much of a hack and I was wondering if there was a faster way of doing it?
Thanks for any pointers
Astan




the "reverse" of a power to is logarithm
so v = 10**n  <=>  math.log(v,10) = n

Arno
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to