You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a known problem, that's unlikely to change unless there's a
serious overhaul of Python's floating point.
The warning at the end of the math module documentation should probably
be taken to apply equally to all the built-in floating-point operations:
"""The 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 useful cross-platform or cross-release way. For example,
whether math.log(0) returns -Inf or raises ValueError or OverflowError
isn't defined, and in cases where math.log(0) raises OverflowError,
math.log(0L) may raise ValueError instead."""
Or, as Tim Peters is fond of saying:
"""All Python behavior in the presence of infinities, NaNs, and signed
zeroes is a platform-dependent accident, mostly inherited from that all
C89 behavior in the presence of infinities, NaNs, and signed zeroes is a
platform-dependent crapshoot."""
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: