Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions Doc/c-api/complex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,12 @@ pointers. This is consistent throughout the API.
representation.


.. c:function:: Py_complex _Py_cr_sum(Py_complex left, double right)

Return the sum of a complex number and a real number, using the C :c:type:`Py_complex`
representation.

.. versionadded:: 3.14


.. c:function:: Py_complex _Py_c_diff(Py_complex left, Py_complex right)

Return the difference between two complex numbers, using the C
:c:type:`Py_complex` representation.


.. c:function:: Py_complex _Py_cr_diff(Py_complex left, double right)

Return the difference between a complex number and a real number, using the C
:c:type:`Py_complex` representation.

.. versionadded:: 3.14


.. c:function:: Py_complex _Py_rc_diff(double left, Py_complex right)

Return the difference between a real number and a complex number, using the C
:c:type:`Py_complex` representation.

.. versionadded:: 3.14


.. c:function:: Py_complex _Py_c_neg(Py_complex num)

Return the negation of the complex number *num*, using the C
Expand All @@ -86,14 +62,6 @@ pointers. This is consistent throughout the API.
representation.


.. c:function:: Py_complex _Py_cr_prod(Py_complex left, double right)

Return the product of a complex number and a real number, using the C
:c:type:`Py_complex` representation.

.. versionadded:: 3.14


.. c:function:: Py_complex _Py_c_quot(Py_complex dividend, Py_complex divisor)

Return the quotient of two complex numbers, using the C :c:type:`Py_complex`
Expand All @@ -103,28 +71,6 @@ pointers. This is consistent throughout the API.
:c:data:`errno` to :c:macro:`!EDOM`.


.. c:function:: Py_complex _Py_cr_quot(Py_complex dividend, double divisor)

Return the quotient of a complex number and a real number, using the C
:c:type:`Py_complex` representation.

If *divisor* is zero, this method returns zero and sets
:c:data:`errno` to :c:macro:`!EDOM`.

.. versionadded:: 3.14


.. c:function:: Py_complex _Py_rc_quot(double dividend, Py_complex divisor)

Return the quotient of a real number and a complex number, using the C
:c:type:`Py_complex` representation.

If *divisor* is zero, this method returns zero and sets
:c:data:`errno` to :c:macro:`!EDOM`.

.. versionadded:: 3.14


.. c:function:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp)

Return the exponentiation of *num* by *exp*, using the C :c:type:`Py_complex`
Expand Down
6 changes: 0 additions & 6 deletions Include/cpython/complexobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@ typedef struct {

// Operations on complex numbers.
PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);
PyAPI_FUNC(Py_complex) _Py_cr_sum(Py_complex, double);
PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);
PyAPI_FUNC(Py_complex) _Py_cr_diff(Py_complex, double);
PyAPI_FUNC(Py_complex) _Py_rc_diff(double, Py_complex);
PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);
PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex);
PyAPI_FUNC(Py_complex) _Py_cr_prod(Py_complex, double);
PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex);
PyAPI_FUNC(Py_complex) _Py_cr_quot(Py_complex, double);
PyAPI_FUNC(Py_complex) _Py_rc_quot(double, Py_complex);
PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex);
PyAPI_FUNC(double) _Py_c_abs(Py_complex);

Expand Down
9 changes: 9 additions & 0 deletions Include/internal/pycore_complexobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ extern int _PyComplex_FormatAdvancedWriter(
Py_ssize_t start,
Py_ssize_t end);

// Operations on complex numbers.
PyAPI_FUNC(Py_complex) _Py_cr_sum(Py_complex, double);
PyAPI_FUNC(Py_complex) _Py_cr_diff(Py_complex, double);
PyAPI_FUNC(Py_complex) _Py_rc_diff(double, Py_complex);
PyAPI_FUNC(Py_complex) _Py_cr_prod(Py_complex, double);
PyAPI_FUNC(Py_complex) _Py_cr_quot(Py_complex, double);
PyAPI_FUNC(Py_complex) _Py_rc_quot(double, Py_complex);


#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 3 additions & 0 deletions Modules/_testcapi/complex.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "parts.h"
#include "util.h"

#define Py_BUILD_CORE
#include "pycore_complexobject.h"


static PyObject *
complex_fromccomplex(PyObject *Py_UNUSED(module), PyObject *obj)
Expand Down
Loading