You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/mpfr/files/3.0.1/patch03

108 lines
3.3 KiB

diff -Naurd mpfr-3.0.1-a/PATCHES mpfr-3.0.1-b/PATCHES
--- mpfr-3.0.1-a/PATCHES 2011-05-05 00:00:35.000000000 +0000
+++ mpfr-3.0.1-b/PATCHES 2011-05-05 00:00:35.000000000 +0000
@@ -0,0 +1 @@
+atan-expo-range
diff -Naurd mpfr-3.0.1-a/VERSION mpfr-3.0.1-b/VERSION
--- mpfr-3.0.1-a/VERSION 2011-05-04 11:18:33.000000000 +0000
+++ mpfr-3.0.1-b/VERSION 2011-05-05 00:00:35.000000000 +0000
@@ -1 +1 @@
-3.0.1-p2
+3.0.1-p3
diff -Naurd mpfr-3.0.1-a/atan.c mpfr-3.0.1-b/atan.c
--- mpfr-3.0.1-a/atan.c 2011-04-04 10:19:18.000000000 +0000
+++ mpfr-3.0.1-b/atan.c 2011-05-05 00:00:35.000000000 +0000
@@ -431,5 +431,5 @@
MPFR_GROUP_CLEAR (group);
MPFR_SAVE_EXPO_FREE (expo);
- return mpfr_check_range (arctgt, inexact, rnd_mode);
+ return mpfr_check_range (atan, inexact, rnd_mode);
}
diff -Naurd mpfr-3.0.1-a/mpfr.h mpfr-3.0.1-b/mpfr.h
--- mpfr-3.0.1-a/mpfr.h 2011-05-04 11:18:33.000000000 +0000
+++ mpfr-3.0.1-b/mpfr.h 2011-05-05 00:00:35.000000000 +0000
@@ -27,7 +27,7 @@
#define MPFR_VERSION_MAJOR 3
#define MPFR_VERSION_MINOR 0
#define MPFR_VERSION_PATCHLEVEL 1
-#define MPFR_VERSION_STRING "3.0.1-p2"
+#define MPFR_VERSION_STRING "3.0.1-p3"
/* Macros dealing with MPFR VERSION */
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff -Naurd mpfr-3.0.1-a/tests/tatan.c mpfr-3.0.1-b/tests/tatan.c
--- mpfr-3.0.1-a/tests/tatan.c 2011-04-04 10:19:17.000000000 +0000
+++ mpfr-3.0.1-b/tests/tatan.c 2011-05-05 00:00:35.000000000 +0000
@@ -535,6 +535,52 @@
mpfr_clears (a, x, y, (mpfr_ptr) 0);
}
+/* http://websympa.loria.fr/wwsympa/arc/mpfr/2011-05/msg00008.html
+ * Incorrect flags (in debug mode on a 32-bit machine, assertion failure).
+ */
+static void
+reduced_expo_range (void)
+{
+ mpfr_exp_t emin, emax;
+ mpfr_t x, y, ex_y;
+ int inex, ex_inex;
+ unsigned int flags, ex_flags;
+
+ emin = mpfr_get_emin ();
+ emax = mpfr_get_emax ();
+
+ mpfr_inits2 (12, x, y, ex_y, (mpfr_ptr) 0);
+ mpfr_set_str (x, "0.1e-5", 2, MPFR_RNDN);
+
+ mpfr_set_emin (-5);
+ mpfr_set_emax (-5);
+ mpfr_clear_flags ();
+ inex = mpfr_atan (y, x, MPFR_RNDN);
+ flags = __gmpfr_flags;
+ mpfr_set_emin (emin);
+ mpfr_set_emax (emax);
+
+ mpfr_set_str (ex_y, "0.1e-5", 2, MPFR_RNDN);
+ ex_inex = 1;
+ ex_flags = MPFR_FLAGS_INEXACT;
+
+ if (SIGN (inex) != ex_inex || flags != ex_flags ||
+ ! mpfr_equal_p (y, ex_y))
+ {
+ printf ("Error in reduced_expo_range\non x = ");
+ mpfr_dump (x);
+ printf ("Expected y = ");
+ mpfr_out_str (stdout, 2, 0, ex_y, MPFR_RNDN);
+ printf ("\n inex = %d, flags = %u\n", ex_inex, ex_flags);
+ printf ("Got y = ");
+ mpfr_out_str (stdout, 2, 0, y, MPFR_RNDN);
+ printf ("\n inex = %d, flags = %u\n", SIGN (inex), flags);
+ exit (1);
+ }
+
+ mpfr_clears (x, y, ex_y, (mpfr_ptr) 0);
+}
+
int
main (int argc, char *argv[])
{
@@ -546,6 +592,7 @@
smallvals_atan2 ();
atan2_bug_20071003 ();
atan2_different_prec ();
+ reduced_expo_range ();
test_generic_atan (2, 200, 17);
test_generic_atan2 (2, 200, 17);
diff -Naurd mpfr-3.0.1-a/version.c mpfr-3.0.1-b/version.c
--- mpfr-3.0.1-a/version.c 2011-05-04 11:18:33.000000000 +0000
+++ mpfr-3.0.1-b/version.c 2011-05-05 00:00:35.000000000 +0000
@@ -25,5 +25,5 @@
const char *
mpfr_get_version (void)
{
- return "3.0.1-p2";
+ return "3.0.1-p3";
}