diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-24 08:14:36 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-24 08:14:36 (GMT) |
commit | bcc0db82dc9cb474d56a4cc63748583232d9524f (patch) | |
tree | 0107d20b29b61fc7dfd9626ee7257242f8cf6302 /Objects/floatobject.c | |
parent | ed483ba63b9c03845386976bccff5d95df5b570a (diff) | |
download | cpython-bcc0db82dc9cb474d56a4cc63748583232d9524f.zip cpython-bcc0db82dc9cb474d56a4cc63748583232d9524f.tar.gz cpython-bcc0db82dc9cb474d56a4cc63748583232d9524f.tar.bz2 |
Get rid of remnants of integer division
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r-- | Objects/floatobject.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c index c27a41a..20ed86e 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -642,25 +642,6 @@ float_div(PyObject *v, PyObject *w) } static PyObject * -float_classic_div(PyObject *v, PyObject *w) -{ - double a,b; - CONVERT_TO_DOUBLE(v, a); - CONVERT_TO_DOUBLE(w, b); - if (Py_DivisionWarningFlag >= 2 && - PyErr_Warn(PyExc_DeprecationWarning, "classic float division") < 0) - return NULL; - if (b == 0.0) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - return NULL; - } - PyFPE_START_PROTECT("divide", return 0) - a = a / b; - PyFPE_END_PROTECT(a) - return PyFloat_FromDouble(a); -} - -static PyObject * float_rem(PyObject *v, PyObject *w) { double vx, wx; @@ -1128,7 +1109,6 @@ static PyNumberMethods float_as_number = { (binaryfunc)float_add, /*nb_add*/ (binaryfunc)float_sub, /*nb_subtract*/ (binaryfunc)float_mul, /*nb_multiply*/ - (binaryfunc)float_classic_div, /*nb_divide*/ (binaryfunc)float_rem, /*nb_remainder*/ (binaryfunc)float_divmod, /*nb_divmod*/ (ternaryfunc)float_pow, /*nb_power*/ @@ -1151,7 +1131,6 @@ static PyNumberMethods float_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 */ |