diff --git a/Doc/library/math.rst b/Doc/library/math.rst index ad36f9234d5..2c1677cbdb6 100644 --- a/Doc/library/math.rst +++ b/Doc/library/math.rst @@ -154,11 +154,15 @@ Power and logarithmic functions: .. function:: pow(x, y) - Return ``x**y``. ``1.0**y`` returns *1.0*, even for ``1.0**nan``. ``0**y`` - returns *0.* for all positive *y*, *0* and *NAN*. + Return ``x`` raised to the power ``y``. Exceptional cases follow + Annex 'F' of the C99 standard as far as possible. In particular, + ``pow(1.0, x)`` and ``pow(x, 0.0)`` always return ``1.0``, even + when ``x`` is a zero or a NaN. If both ``x`` and ``y`` are finite, + ``x`` is negative, and ``y`` is not an integer then ``pow(x, y)`` + is undefined, and raises :exc:`ValueError`. .. versionchanged:: 2.6 - The outcome of ``1**nan`` and ``0**nan`` was undefined. + The outcome of ``1**nan`` and ``nan**0`` was undefined. .. function:: sqrt(x) @@ -290,7 +294,7 @@ The module also defines two mathematical constants: :exc:`OverflowError` isn't defined, and in cases where ``math.log(0)`` raises :exc:`OverflowError`, ``math.log(0L)`` may raise :exc:`ValueError` instead. - All functions return a quite *NaN* if at least one of the args is *NaN*. + All functions return a quiet *NaN* if at least one of the args is *NaN*. Signaling *NaN*s raise an exception. The exception type still depends on the platform and libm implementation. It's usually :exc:`ValueError` for *EDOM* and :exc:`OverflowError` for errno *ERANGE*.