summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/long.rst33
1 files changed, 33 insertions, 0 deletions
diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst
index 9ff3e52..32bb451 100644
--- a/Doc/c-api/long.rst
+++ b/Doc/c-api/long.rst
@@ -582,6 +582,39 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
.. versionadded:: 3.14
+.. c:function:: int PyLong_IsPositive(PyObject *obj)
+
+ Check if the integer object *obj* is positive (``obj > 0``).
+
+ If *obj* is an instance of :c:type:`PyLongObject` or its subtype,
+ return ``1`` when it's positive and ``0`` otherwise. Else set an
+ exception and return ``-1``.
+
+ .. versionadded:: next
+
+
+.. c:function:: int PyLong_IsNegative(PyObject *obj)
+
+ Check if the integer object *obj* is negative (``obj < 0``).
+
+ If *obj* is an instance of :c:type:`PyLongObject` or its subtype,
+ return ``1`` when it's negative and ``0`` otherwise. Else set an
+ exception and return ``-1``.
+
+ .. versionadded:: next
+
+
+.. c:function:: int PyLong_IsZero(PyObject *obj)
+
+ Check if the integer object *obj* is zero.
+
+ If *obj* is an instance of :c:type:`PyLongObject` or its subtype,
+ return ``1`` when it's zero and ``0`` otherwise. Else set an
+ exception and return ``-1``.
+
+ .. versionadded:: next
+
+
.. c:function:: PyObject* PyLong_GetInfo(void)
On success, return a read only :term:`named tuple`, that holds