Merge pull request #578 from PX4/fix_mp_prime_strong_lucas_lefridge_compilation
[libtommath.git] / s_mp_log_2expt.c
blobec0fda3b7da010960ff558c60a360969340032b9
1 #include "tommath_private.h"
2 #ifdef S_MP_LOG_2EXPT_C
3 /* LibTomMath, multiple-precision integer library -- Tom St Denis */
4 /* SPDX-License-Identifier: Unlicense */
6 int s_mp_log_2expt(const mp_int *a, mp_digit base)
8 int y;
9 for (y = 0; (base & 1) == 0; y++, base >>= 1) {}
10 return (mp_count_bits(a) - 1) / y;
12 #endif