mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
Get rid of remnants of integer division
This commit is contained in:
parent
ed483ba63b
commit
bcc0db82dc
28 changed files with 47 additions and 212 deletions
|
@ -381,27 +381,6 @@ complex_div(PyComplexObject *v, PyComplexObject *w)
|
|||
return PyComplex_FromCComplex(quot);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
complex_classic_div(PyComplexObject *v, PyComplexObject *w)
|
||||
{
|
||||
Py_complex quot;
|
||||
|
||||
if (Py_DivisionWarningFlag >= 2 &&
|
||||
PyErr_Warn(PyExc_DeprecationWarning,
|
||||
"classic complex division") < 0)
|
||||
return NULL;
|
||||
|
||||
PyFPE_START_PROTECT("complex_classic_div", return 0)
|
||||
errno = 0;
|
||||
quot = c_quot(v->cval,w->cval);
|
||||
PyFPE_END_PROTECT(quot)
|
||||
if (errno == EDOM) {
|
||||
PyErr_SetString(PyExc_ZeroDivisionError, "complex division");
|
||||
return NULL;
|
||||
}
|
||||
return PyComplex_FromCComplex(quot);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
complex_remainder(PyComplexObject *v, PyComplexObject *w)
|
||||
{
|
||||
|
@ -948,7 +927,6 @@ static PyNumberMethods complex_as_number = {
|
|||
(binaryfunc)complex_add, /* nb_add */
|
||||
(binaryfunc)complex_sub, /* nb_subtract */
|
||||
(binaryfunc)complex_mul, /* nb_multiply */
|
||||
(binaryfunc)complex_classic_div, /* nb_divide */
|
||||
(binaryfunc)complex_remainder, /* nb_remainder */
|
||||
(binaryfunc)complex_divmod, /* nb_divmod */
|
||||
(ternaryfunc)complex_pow, /* nb_power */
|
||||
|
@ -971,7 +949,6 @@ static PyNumberMethods complex_as_number = {
|
|||
0, /* nb_inplace_add */
|
||||
0, /* nb_inplace_subtract */
|
||||
0, /* nb_inplace_multiply*/
|
||||
0, /* nb_inplace_divide */
|
||||
0, /* nb_inplace_remainder */
|
||||
0, /* nb_inplace_power */
|
||||
0, /* nb_inplace_lshift */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue