[Tutor] raising number to a power

Monte Milanuk memilanuk at gmail.com
Thu Feb 25 18:27:06 CET 2010


So... pow(4,4) is equivalent to 4**4, which works on anything - integers,
floats, etc., but math.pow(4,4) only works on floats... and in this case it
converts or interprets (4,4) as (4.0,4.0), hence returning a float: 256.0.
Is that about right?

Thanks,

Monte
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100225/d6747984/attachment.html>


More information about the Tutor mailing list