File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ static PyObject *
164
164
imath_ilog2 (PyObject * module , PyObject * n )
165
165
/*[clinic end generated code: output=6ab48d1a7f5160c2 input=e2d8e8631ec5c29b]*/
166
166
{
167
- size_t bits ;
167
+ int64_t bits ;
168
168
169
169
n = PyNumber_Index (n );
170
170
if (n == NULL ) {
@@ -174,17 +174,17 @@ imath_ilog2(PyObject *module, PyObject *n)
174
174
if (!_PyLong_IsPositive ((PyLongObject * )n )) {
175
175
PyErr_SetString (
176
176
PyExc_ValueError ,
177
- "ilog () argument must be positive" );
177
+ "ilog2 () argument must be positive" );
178
178
Py_DECREF (n );
179
179
return NULL ;
180
180
}
181
181
182
182
bits = _PyLong_NumBits (n );
183
183
Py_DECREF (n );
184
- if (bits == ( size_t )( -1 ) ) {
184
+ if (bits == -1 ) {
185
185
return NULL ;
186
186
}
187
- return PyLong_FromSize_t (bits - 1 );
187
+ return PyLong_FromInt64 (bits - 1 );
188
188
}
189
189
190
190
You can’t perform that action at this time.
0 commit comments