mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
This reverts commit 0ef92d9793
.
This commit is contained in:
parent
19ac43629e
commit
0672a6c23b
8 changed files with 47 additions and 42 deletions
|
@ -2366,24 +2366,26 @@ loghelper(PyObject* arg, double (*func)(double))
|
|||
math.log
|
||||
|
||||
x: object
|
||||
base: object = None
|
||||
[
|
||||
base: object(c_default="NULL") = math.e
|
||||
]
|
||||
/
|
||||
|
||||
Return the logarithm of x to the given base.
|
||||
|
||||
If the base is not specified or is None, returns the natural
|
||||
logarithm (base e) of x.
|
||||
If the base not specified, returns the natural logarithm (base e) of x.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
math_log_impl(PyObject *module, PyObject *x, PyObject *base)
|
||||
/*[clinic end generated code: output=1dead263cbb1e854 input=ef032cc9837943e1]*/
|
||||
math_log_impl(PyObject *module, PyObject *x, int group_right_1,
|
||||
PyObject *base)
|
||||
/*[clinic end generated code: output=7b5a39e526b73fc9 input=0f62d5726cbfebbd]*/
|
||||
{
|
||||
PyObject *num, *den;
|
||||
PyObject *ans;
|
||||
|
||||
num = loghelper(x, m_log);
|
||||
if (num == NULL || base == Py_None)
|
||||
if (num == NULL || base == NULL)
|
||||
return num;
|
||||
|
||||
den = loghelper(base, m_log);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue