On Fri, 26 Feb 2010 04:27:06 am Monte Milanuk wrote:
> 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?

Pretty much, but the builtin pow also takes an optional third argument:

>>> pow(4, 4, 65)  # same as 4**4 % 65 only more efficient
61

By the way, are you aware that you can get help in the interactive 
interpreter?

help(pow)


-- 
Steven D'Aprano
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to