Commit 70af503a6e3fffc3c86e7e20c1a3fa06c82a0d73

Francois Perrad 2018-11-28T10:48:04

literal suffix

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/bn_mp_set_double.c b/bn_mp_set_double.c
index 54b2d09..51ab47d 100644
--- a/bn_mp_set_double.c
+++ b/bn_mp_set_double.c
@@ -25,7 +25,7 @@ int mp_set_double(mp_int *a, double b)
    cast.dbl = b;
 
    exp = (int)(cast.bits >> 52) & 0x7FF;
-   frac = (cast.bits & ((1ULL << 52) - 1)) | (1ULL << 52);
+   frac = (cast.bits & ((1ULL << 52) - 1ULL)) | (1ULL << 52);
 
    if (exp == 0x7FF) { /* +-inf, NaN */
       return MP_VAL;