469,306 Members | 1,896 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Re: get number that is raised to the power of


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
Jun 27 '08 #1
0 850

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Matt | last post: by
2 posts views Thread by ashu | last post: by
20 posts views Thread by ravi | last post: by
6 posts views Thread by TDBNDVVDSC | last post: by
2 posts views Thread by Astan Chee | last post: by
reply views Thread by Astan Chee | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.