New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmath.log doesn't have the same interface as math.log. #39404
Comments
Somewhere along the way, math.log gained an optional >>> print math.log.__doc__
log(x[, base]) -> the logarithm of x to the given base.
If the base not specified, returns the natural
logarithm (base e) of x.
>>> print cmath.log.__doc__
log(x) Return the natural logarithm of x. |
Logged In: YES See patch bpo-826074 for a fix. |
Logged In: YES I can fix this if necessary. My question is whether it should be done. On the one hand, |
Logged In: YES Base 2 logarithms are somewhat common. |
Logged In: YES In my particular usecase, I define an environment in which _mathEnv = {'__builtins__': new.module('__builtins__'), 'i': 1j}
_mathEnv.update(math.__dict__)
_mathEnv.update(cmath.__dict__) As you can see, the cmath definitions shadow the math That's at least my particular use case. In this particular |
Logged In: YES Applied Andrew Gaul's patch (with minor modifications) as |
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: