summaryrefslogtreecommitdiff
path: root/Include/pymath.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/pymath.h')
-rw-r--r--Include/pymath.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/pymath.h b/Include/pymath.h
index f869724334..63ca972784 100644
--- a/Include/pymath.h
+++ b/Include/pymath.h
@@ -227,4 +227,12 @@ PyAPI_FUNC(void) _Py_set_387controlword(unsigned short);
* behavior. */
#define _Py_InIntegralTypeRange(type, v) (_Py_IntegralTypeMin(type) <= v && v <= _Py_IntegralTypeMax(type))
+/* Return the smallest integer k such that n < 2**k, or 0 if n == 0.
+ * Equivalent to floor(log2(x))+1. Also equivalent to: bitwidth_of_type -
+ * count_leading_zero_bits(x)
+ */
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(unsigned int) _Py_bit_length(unsigned long d);
+#endif
+
#endif /* Py_PYMATH_H */