[Tutor] cube root

col speed ajarncolin at gmail.com
Mon Jan 19 07:28:44 CET 2009


Hi there, just a quick one.
Is there a way to obtain cube roots in python?
I have been trying:
math.pow(n,1.0/3)
This works with some, but with 64, for example I get:
>>> pow(64,1.0/3)
3.9999999999999996
However:
>>> 4**3
64
Any ideas?
Thanks
Colin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090119/a604738d/attachment-0001.htm>


More information about the Tutor mailing list