Commit 6f652de71e8aafb062db5a676d728b209c907611

Francois Perrad 2018-11-28T10:42:11

use literal float

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/bn_mp_get_double.c b/bn_mp_get_double.c
index 542993d..ea78b9f 100644
--- a/bn_mp_get_double.c
+++ b/bn_mp_get_double.c
@@ -16,9 +16,9 @@
 double mp_get_double(const mp_int *a)
 {
    int i;
-   double d = 0, fac = 1;
+   double d = 0.0, fac = 1.0;
    for (i = 0; i < DIGIT_BIT; ++i) {
-      fac *= 2;
+      fac *= 2.0;
    }
    for (i = USED(a); i --> 0;) {
       d = d * fac + (double)DIGIT(a, i);