Commit fd7a0a3abb4f5f53c9e0ec656b88b04028c76bef

Francois Perrad 2019-10-15T18:14:00

explicit condition

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/bn_mp_log_u32.c b/bn_mp_log_u32.c
index dd62c30..f7bca01 100644
--- a/bn_mp_log_u32.c
+++ b/bn_mp_log_u32.c
@@ -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;