Commit d1b52524f1188e4827f6499454b2e6990db71e14

Francois Perrad 2018-11-28T10:50:20

explicit operator precedence

diff --git a/bn_mp_get_double.c b/bn_mp_get_double.c
index a192fb1..8ce314f 100644
--- a/bn_mp_get_double.c
+++ b/bn_mp_get_double.c
@@ -21,7 +21,7 @@ double mp_get_double(const mp_int *a)
       fac *= 2.0;
    }
    for (i = USED(a); i --> 0;) {
-      d = d * fac + (double)DIGIT(a, i);
+      d = (d * fac) + (double)DIGIT(a, i);
    }
    return (mp_isneg(a) != MP_NO) ? -d : d;
 }
diff --git a/bn_mp_set_double.c b/bn_mp_set_double.c
index e9697fc..5513af1 100644
--- a/bn_mp_set_double.c
+++ b/bn_mp_set_double.c
@@ -37,7 +37,7 @@ int mp_set_double(mp_int *a, double b)
       return res;
    }
 
-   res = exp < 0 ? mp_div_2d(a, -exp, a, NULL) : mp_mul_2d(a, exp, a);
+   res = (exp < 0) ? mp_div_2d(a, -exp, a, NULL) : mp_mul_2d(a, exp, a);
    if (((cast.bits >> 63) != 0ULL) && (mp_iszero(a) == MP_NO)) {
       SIGN(a) = MP_NEG;
    }