summaryrefslogtreecommitdiff
path: root/patches/mpfr/3.1.2/170-exp3.patch
blob: 378c3bf4fcf0b6e7cc4d17cad84d7a76a88acaf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
--- mpfr-3.1.2-a/PATCHES	2014-04-15 22:04:57.090286262 +0000
+++ mpfr-3.1.2-b/PATCHES	2014-04-15 22:04:57.162288198 +0000
@@ -0,0 +1 @@
+exp3
diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
--- mpfr-3.1.2-a/VERSION	2014-04-15 22:04:57.086286154 +0000
+++ mpfr-3.1.2-b/VERSION	2014-04-15 22:04:57.162288198 +0000
@@ -1 +1 @@
-3.1.2-p6
+3.1.2-p7
diff -Naurd mpfr-3.1.2-a/src/exp3.c mpfr-3.1.2-b/src/exp3.c
--- mpfr-3.1.2-a/src/exp3.c	2013-03-13 15:37:34.000000000 +0000
+++ mpfr-3.1.2-b/src/exp3.c	2014-04-15 22:04:57.126287230 +0000
@@ -283,7 +283,7 @@
             }
         }
 
-      if (mpfr_can_round (shift_x > 0 ? t : tmp, realprec, MPFR_RNDD, MPFR_RNDZ,
+      if (mpfr_can_round (shift_x > 0 ? t : tmp, realprec, MPFR_RNDN, MPFR_RNDZ,
                           MPFR_PREC(y) + (rnd_mode == MPFR_RNDN)))
         {
           inexact = mpfr_set (y, shift_x > 0 ? t : tmp, rnd_mode);
diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
--- mpfr-3.1.2-a/src/mpfr.h	2014-04-15 22:04:57.086286154 +0000
+++ mpfr-3.1.2-b/src/mpfr.h	2014-04-15 22:04:57.162288198 +0000
@@ -27,7 +27,7 @@
 #define MPFR_VERSION_MAJOR 3
 #define MPFR_VERSION_MINOR 1
 #define MPFR_VERSION_PATCHLEVEL 2
-#define MPFR_VERSION_STRING "3.1.2-p6"
+#define MPFR_VERSION_STRING "3.1.2-p7"
 
 /* Macros dealing with MPFR VERSION */
 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
--- mpfr-3.1.2-a/src/version.c	2014-04-15 22:04:57.090286262 +0000
+++ mpfr-3.1.2-b/src/version.c	2014-04-15 22:04:57.162288198 +0000
@@ -25,5 +25,5 @@
 const char *
 mpfr_get_version (void)
 {
-  return "3.1.2-p6";
+  return "3.1.2-p7";
 }
diff -Naurd mpfr-3.1.2-a/tests/texp.c mpfr-3.1.2-b/tests/texp.c
--- mpfr-3.1.2-a/tests/texp.c	2013-03-13 15:37:44.000000000 +0000
+++ mpfr-3.1.2-b/tests/texp.c	2014-04-15 22:04:57.126287230 +0000
@@ -150,6 +150,22 @@
       exit (1);
     }
 
+  mpfr_set_prec (x, 118);
+  mpfr_set_str_binary (x, "0.1110010100011101010000111110011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E-86");
+  mpfr_set_prec (y, 118);
+  mpfr_exp_2 (y, x, MPFR_RNDU);
+  mpfr_exp_3 (x, x, MPFR_RNDU);
+  if (mpfr_cmp (x, y))
+    {
+      printf ("mpfr_exp_2 and mpfr_exp_3 differ for prec=118\n");
+      printf ("mpfr_exp_2 gives ");
+      mpfr_out_str (stdout, 2, 0, y, MPFR_RNDN);
+      printf ("\nmpfr_exp_3 gives ");
+      mpfr_out_str (stdout, 2, 0, x, MPFR_RNDN);
+      printf ("\n");
+      exit (1);
+    }
+
   mpfr_clear (x);
   mpfr_clear (y);
   return 0;