aboutsummaryrefslogtreecommitdiff
path: root/src/big_int.cpp
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2024-07-27 04:20:03 +0200
committerLaytan Laats <laytanlaats@hotmail.com>2024-08-14 01:44:35 +0200
commitefe68c2e24e0a38e591f146822ed93904e4193d7 (patch)
treec2ac0ed3d08746495aa6adcd7a1c1ab052a7ee76 /src/big_int.cpp
parentac68a9d52c3a9edc587e1ccab747613baf6f89de (diff)
posix: add package
Diffstat (limited to 'src/big_int.cpp')
-rw-r--r--src/big_int.cpp4
1 files changed, 4 insertions, 0 deletions
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;
+}