explicit condition

This commit is contained in:
Francois Perrad 2019-10-15 18:14:00 +02:00
parent fd5c835c99
commit fd7a0a3abb

View File

@ -92,9 +92,9 @@ mp_err mp_log_u32(const mp_int *a, uint32_t base, uint32_t *c)
}
/* A small shortcut for bases that are powers of two. */
if (!(base & (base - 1u))) {
if ((base & (base - 1u)) == 0u) {
int y, bit_count;
for (y=0; (y < 7) && !(base & 1u); y++) {
for (y=0; (y < 7) && ((base & 1u) == 0u); y++) {
base >>= 1;
}
bit_count = mp_count_bits(a) - 1;