Commit 965697fc authored by Tim Peters's avatar Tim Peters

Clarified new text about math exceptions.

Bugfix candidate.
parent 4931130f
...@@ -146,13 +146,18 @@ The mathematical constant \emph{e}. ...@@ -146,13 +146,18 @@ The mathematical constant \emph{e}.
\end{datadesc} \end{datadesc}
\begin{notice} \begin{notice}
Specific exceptions raised in assorted error cases (and even whether some The \module{math} module consists mostly of thin wrappers around
the platform C math library functions. Behavior in exceptional cases is
loosely specified by the C standards, and Python inherits much of its
math-function error-reporting behavior from the platform C
implementation. As a result,
the specific exceptions raised in error cases (and even whether some
arguments are considered to be exceptional at all) are not defined in any arguments are considered to be exceptional at all) are not defined in any
useful cross-platform or cross-release way. For example, whether useful cross-platform or cross-release way. For example, whether
\code{math.log(0)} returns \code{-Inf} or raises \exception{ValueError} or \code{math.log(0)} returns \code{-Inf} or raises \exception{ValueError} or
\exception{OverflowError} is both platform- and release-dependent, and in \exception{OverflowError} isn't defined, and in
cases where \code{math.log(0)} raises an \exception{OverflowError}, cases where \code{math.log(0)} raises \exception{OverflowError},
\code{math.log(0L)} often raises a \exception{ValueError}. \code{math.log(0L)} may raise \exception{ValueError} instead.
\end{notice} \end{notice}
\begin{seealso} \begin{seealso}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment