summaryrefslogtreecommitdiff
path: root/patches/mpfr/3.1.3/230-gamma.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/mpfr/3.1.3/230-gamma.patch')
-rw-r--r--patches/mpfr/3.1.3/230-gamma.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/patches/mpfr/3.1.3/230-gamma.patch b/patches/mpfr/3.1.3/230-gamma.patch
new file mode 100644
index 0000000..47d4e41
--- /dev/null
+++ b/patches/mpfr/3.1.3/230-gamma.patch
@@ -0,0 +1,77 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-23 07:43:23.702095604 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-23 07:43:23.726095285 +0000
+@@ -0,0 +1 @@
++gamma
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-15 15:20:51.306696441 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-23 07:43:23.726095285 +0000
+@@ -1 +1 @@
+-3.1.3-p12
++3.1.3-p13
+diff -Naurd mpfr-3.1.3-a/src/gamma.c mpfr-3.1.3-b/src/gamma.c
+--- mpfr-3.1.3-a/src/gamma.c 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/gamma.c 2016-02-23 07:43:23.718095391 +0000
+@@ -70,6 +70,9 @@
+ {
+ mpfr_t x, y;
+ unsigned long r, k;
++ MPFR_SAVE_EXPO_DECL (expo);
++
++ MPFR_SAVE_EXPO_MARK (expo);
+ mpfr_init2 (x, 38);
+ mpfr_init2 (y, 38);
+ mpfr_set_ui (x, n, MPFR_RNDZ);
+@@ -86,6 +89,8 @@
+ r -= n / k;
+ mpfr_clear (x);
+ mpfr_clear (y);
++ MPFR_SAVE_EXPO_FREE (expo);
++
+ return r;
+ }
+
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-15 15:20:51.302696439 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-23 07:43:23.726095285 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p12"
++#define MPFR_VERSION_STRING "3.1.3-p13"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-15 15:20:51.306696441 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-23 07:43:23.726095285 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p12";
++ return "3.1.3-p13";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tgamma.c mpfr-3.1.3-b/tests/tgamma.c
+--- mpfr-3.1.3-a/tests/tgamma.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tgamma.c 2016-02-23 07:43:23.718095391 +0000
+@@ -192,6 +192,18 @@
+ exit (1);
+ }
+
++ mpfr_set_prec (x, 2);
++ mpfr_set_prec (y, 2);
++ mpfr_set_ui (x, 2, MPFR_RNDN);
++ mpfr_clear_inexflag ();
++ mpfr_gamma (y, x, MPFR_RNDN);
++ if (mpfr_inexflag_p ())
++ {
++ printf ("Wrong inexact flag for gamma(2)\n");
++ printf ("expected 0, got 1\n");
++ exit (1);
++ }
++
+ mpfr_clear (x);
+ mpfr_clear (y);
+ }