summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index a4d90b1..ce4f0d7 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -3155,14 +3155,11 @@ long_add(PyLongObject *a, PyLongObject *b)
return _PyLong_Add(a, b);
}
-
-static PyObject *
-long_sub(PyLongObject *a, PyLongObject *b)
+PyObject *
+_PyLong_Subtract(PyLongObject *a, PyLongObject *b)
{
PyLongObject *z;
- CHECK_BINOP(a, b);
-
if (IS_MEDIUM_VALUE(a) && IS_MEDIUM_VALUE(b)) {
return _PyLong_FromSTwoDigits(medium_value(a) - medium_value(b));
}
@@ -3187,6 +3184,13 @@ long_sub(PyLongObject *a, PyLongObject *b)
return (PyObject *)z;
}
+static PyObject *
+long_sub(PyLongObject *a, PyLongObject *b)
+{
+ CHECK_BINOP(a, b);
+ return _PyLong_Subtract(a, b);
+}
+
/* Grade school multiplication, ignoring the signs.
* Returns the absolute value of the product, or NULL if error.
*/