File tree 4 files changed +23
-15
lines changed
4 files changed +23
-15
lines changed Original file line number Diff line number Diff line change 4
4
5
5
PyAPI_FUNC (PyObject * ) PyLong_FromUnicodeObject (PyObject * u , int base );
6
6
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
-
22
7
PyAPI_FUNC (int ) PyUnstable_Long_IsCompact (const PyLongObject * op );
23
8
PyAPI_FUNC (Py_ssize_t ) PyUnstable_Long_CompactValue (const PyLongObject * op );
24
9
Original file line number Diff line number Diff line change @@ -58,6 +58,23 @@ PyAPI_FUNC(PyLongObject*) _PyLong_FromDigits(
58
58
Py_ssize_t digit_count ,
59
59
digit * digits );
60
60
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
+
61
78
62
79
/* runtime lifecycle */
63
80
Original file line number Diff line number Diff line change 10
10
#include "Python.h"
11
11
#include "pycore_abstract.h" // _PyNumber_Index()
12
12
#include "pycore_initconfig.h" // _PyStatus_OK()
13
+ #include "pycore_long.h" // _PyLong_Sign()
13
14
#include "pycore_pyerrors.h" // _PyErr_ChainExceptions1()
14
15
#include "pycore_pystate.h" // _PyInterpreterState_GET()
15
16
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
+
1
5
#include "parts.h"
2
6
#include "clinic/long.c.h"
7
+ #include "pycore_long.h" // _PyLong_Sign()
3
8
4
9
/*[clinic input]
5
10
module _testcapi
You can’t perform that action at this time.
0 commit comments