File tree Expand file tree Collapse file tree 4 files changed +23
-15
lines changed Expand file tree Collapse file tree 4 files changed +23
-15
lines changed Original file line number Diff line number Diff line change 44
55PyAPI_FUNC (PyObject * ) PyLong_FromUnicodeObject (PyObject * u , int base );
66
7- /* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0.
8- v must not be NULL, and must be a normalized long.
9- There are no error cases.
10- */
11- PyAPI_FUNC (int ) _PyLong_Sign (PyObject * v );
12-
13- /* _PyLong_NumBits. Return the number of bits needed to represent the
14- absolute value of a long. For example, this returns 1 for 1 and -1, 2
15- for 2 and -2, and 2 for 3 and -3. It returns 0 for 0.
16- v must not be NULL, and must be a normalized long.
17- (size_t)-1 is returned and OverflowError set if the true result doesn't
18- fit in a size_t.
19- */
20- PyAPI_FUNC (size_t ) _PyLong_NumBits (PyObject * v );
21-
227PyAPI_FUNC (int ) PyUnstable_Long_IsCompact (const PyLongObject * op );
238PyAPI_FUNC (Py_ssize_t ) PyUnstable_Long_CompactValue (const PyLongObject * op );
249
Original file line number Diff line number Diff line change @@ -58,6 +58,23 @@ PyAPI_FUNC(PyLongObject*) _PyLong_FromDigits(
5858 Py_ssize_t digit_count ,
5959 digit * digits );
6060
61+ // _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0.
62+ // v must not be NULL, and must be a normalized long.
63+ // There are no error cases.
64+ //
65+ // Export for '_pickle' shared extension.
66+ PyAPI_FUNC (int ) _PyLong_Sign (PyObject * v );
67+
68+ // _PyLong_NumBits. Return the number of bits needed to represent the
69+ // absolute value of a long. For example, this returns 1 for 1 and -1, 2
70+ // for 2 and -2, and 2 for 3 and -3. It returns 0 for 0.
71+ // v must not be NULL, and must be a normalized long.
72+ // (size_t)-1 is returned and OverflowError set if the true result doesn't
73+ // fit in a size_t.
74+ //
75+ // Export for 'math' shared extension.
76+ PyAPI_FUNC (size_t ) _PyLong_NumBits (PyObject * v );
77+
6178
6279/* runtime lifecycle */
6380
Original file line number Diff line number Diff line change 1010#include "Python.h"
1111#include "pycore_abstract.h" // _PyNumber_Index()
1212#include "pycore_initconfig.h" // _PyStatus_OK()
13+ #include "pycore_long.h" // _PyLong_Sign()
1314#include "pycore_pyerrors.h" // _PyErr_ChainExceptions1()
1415#include "pycore_pystate.h" // _PyInterpreterState_GET()
1516
Original file line number Diff line number Diff line change 1+ #ifndef Py_BUILD_CORE_BUILTIN
2+ # define Py_BUILD_CORE_MODULE 1
3+ #endif
4+
15#include "parts.h"
26#include "clinic/long.c.h"
7+ #include "pycore_long.h" // _PyLong_Sign()
38
49/*[clinic input]
510module _testcapi
You can’t perform that action at this time.
0 commit comments