built-in pow() vs. math.pow()

Peter J. Holzer hjp-python at hjp.at
Fri Mar 31 15:21:37 EDT 2023


On 2023-03-31 07:39:25 +0100, Barry wrote:
> On 30 Mar 2023, at 22:30, Chris Angelico <rosuav at gmail.com> wrote:
> > It's called math.pow. That on its own should be a strong indication
> > that it's designed to work with floats.
> 
> So long as you know that the math module is provided to give access
> the C math.h functions.
> 

Well, that's the first line in the docs:

| This module provides access to the mathematical functions defined by
| the C standard.

Of course a Python programmer may not necessarily know what mathematical
functions the C standard defines or even what C is.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp at hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/python-list/attachments/20230331/a8e8a780/attachment.sig>


More information about the Python-list mailing list