From 85c2aaf0a426158e96261ddace4d5287c646ba58 Mon Sep 17 00:00:00 2001 From: misomosi Date: Sun, 28 Jun 2026 19:25:02 -0400 Subject: [PATCH] Use libtommath API for counting bits --- src/big_int.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/big_int.cpp b/src/big_int.cpp index 4f20f2ad9..a8ea2079b 100644 --- a/src/big_int.cpp +++ b/src/big_int.cpp @@ -296,8 +296,7 @@ gb_internal void big_int_from_string(BigInt *dst, String const &s, bool *success gb_internal bool big_int_can_be_represented_in_64_bits(BigInt const *x) { - int bits_used = (x->used-1) * MP_DIGIT_BIT; - return bits_used <= 64; + return mp_count_bits(x) <= 64; } gb_internal u64 big_int_to_u64(BigInt const *x) {