Commit d7b7dfee537fbd0669933c20403c4c260130a218

Francois Perrad 2018-12-01T08:33:02

explicit cast

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 0e230c7..f0de20c 100644
--- a/bn_mp_set_double.c
+++ b/bn_mp_set_double.c
@@ -24,7 +24,7 @@ int mp_set_double(mp_int *a, double b)
    } cast;
    cast.dbl = b;
 
-   exp = (unsigned)(cast.bits >> 52) & 0x7FFU;
+   exp = (int)((unsigned)(cast.bits >> 52) & 0x7FFU);
    frac = (cast.bits & ((1ULL << 52) - 1ULL)) | (1ULL << 52);
 
    if (exp == 0x7FF) { /* +-inf, NaN */