From efe68c2e24e0a38e591f146822ed93904e4193d7 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Sat, 27 Jul 2024 04:20:03 +0200 Subject: posix: add package --- src/big_int.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/big_int.cpp') diff --git a/src/big_int.cpp b/src/big_int.cpp index e350687b4..83235483c 100644 --- a/src/big_int.cpp +++ b/src/big_int.cpp @@ -621,3 +621,7 @@ gb_internal String big_int_to_string(gbAllocator allocator, BigInt const *x, u64 } return make_string(cast(u8 *)buf.data, buf.count); } + +gb_internal int big_int_log2(BigInt const *x) { + return mp_count_bits(x) - 1; +} -- cgit v1.2.3