diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2024-08-14 15:10:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-14 15:10:31 +0100 |
| commit | e810c3eacec9cae74a369c747bbc5bd2a386d20d (patch) | |
| tree | f6ddfebe971d21ae6dc3ecf4c86c862c1c3ee96c /src/big_int.cpp | |
| parent | 18b6af185881b7ad413157af5c21bf9d77712632 (diff) | |
| parent | e29f0a0f40019d9a235e617759a24032a9688f85 (diff) | |
Merge pull request #4012 from laytan/posix
core:sys/posix and core:os/os2 based on it (for darwin, netbsd, freebsd and openbsd)
Diffstat (limited to 'src/big_int.cpp')
| -rw-r--r-- | src/big_int.cpp | 4 |
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; +} |