diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-09-01 14:36:15 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-09-01 19:13:47 +0200 |
| commit | fd83cbf40bad98e7d50d75bee2cdf4a5d3d54921 (patch) | |
| tree | 981e80475ca2334062676d97c2d8d1c300c5588e /core/math/big/private.odin | |
| parent | 7d7ed6b95f50ec36e6ed5ad6bded466ca75de26e (diff) | |
big: Add `ilog2`.
Diffstat (limited to 'core/math/big/private.odin')
| -rw-r--r-- | core/math/big/private.odin | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/big/private.odin b/core/math/big/private.odin index d2878fcc1..72f5bb9e2 100644 --- a/core/math/big/private.odin +++ b/core/math/big/private.odin @@ -1437,7 +1437,7 @@ _private_int_factorial_binary_split :: proc(res: ^Int, n: int, allocator := cont internal_one(inner, false) or_return;
internal_one(outer, false) or_return;
- bits_used := int(_DIGIT_TYPE_BITS - intrinsics.count_leading_zeros(n));
+ bits_used := ilog2(n);
for i := bits_used; i >= 0; i -= 1 {
start := (n >> (uint(i) + 1)) + 1 | 1;
|