mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
gh-116560: Add PyLong_GetSign() public function (#116561)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
367adc91fb
commit
61d3ab32da
7 changed files with 66 additions and 3 deletions
|
@ -494,6 +494,19 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
|
|||
.. versionadded:: 3.13
|
||||
|
||||
|
||||
.. c:function:: int PyLong_GetSign(PyObject *obj, int *sign)
|
||||
|
||||
Get the sign of the integer object *obj*.
|
||||
|
||||
On success, set *\*sign* to the integer sign (0, -1 or +1 for zero, negative or
|
||||
positive integer, respectively) and return 0.
|
||||
|
||||
On failure, return -1 with an exception set. This function always succeeds
|
||||
if *obj* is a :c:type:`PyLongObject` or its subtype.
|
||||
|
||||
.. versionadded:: 3.14
|
||||
|
||||
|
||||
.. c:function:: int PyUnstable_Long_IsCompact(const PyLongObject* op)
|
||||
|
||||
Return 1 if *op* is compact, 0 otherwise.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue