1 From http://www.mpfr.org/mpfr-current/allpatches
4 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
6 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
7 --- mpfr-3.1.2-a/PATCHES 2013-09-26 10:52:52.000000000 +0000
8 +++ mpfr-3.1.2-b/PATCHES 2013-09-26 10:52:52.000000000 +0000
11 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
12 --- mpfr-3.1.2-a/VERSION 2013-03-13 15:37:28.000000000 +0000
13 +++ mpfr-3.1.2-b/VERSION 2013-09-26 10:52:52.000000000 +0000
17 diff -Naurd mpfr-3.1.2-a/src/exp_2.c mpfr-3.1.2-b/src/exp_2.c
18 --- mpfr-3.1.2-a/src/exp_2.c 2013-03-13 15:37:28.000000000 +0000
19 +++ mpfr-3.1.2-b/src/exp_2.c 2013-09-26 10:52:52.000000000 +0000
21 for (k = 0; k < K; k++)
26 exps += mpz_normalize (ss, ss, q);
28 mpfr_set_z (s, ss, MPFR_RNDN);
29 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
30 --- mpfr-3.1.2-a/src/mpfr.h 2013-03-13 15:37:37.000000000 +0000
31 +++ mpfr-3.1.2-b/src/mpfr.h 2013-09-26 10:52:52.000000000 +0000
33 #define MPFR_VERSION_MAJOR 3
34 #define MPFR_VERSION_MINOR 1
35 #define MPFR_VERSION_PATCHLEVEL 2
36 -#define MPFR_VERSION_STRING "3.1.2"
37 +#define MPFR_VERSION_STRING "3.1.2-p1"
39 /* Macros dealing with MPFR VERSION */
40 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
41 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
42 --- mpfr-3.1.2-a/src/version.c 2013-03-13 15:37:34.000000000 +0000
43 +++ mpfr-3.1.2-b/src/version.c 2013-09-26 10:52:52.000000000 +0000
46 mpfr_get_version (void)
51 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
52 --- mpfr-3.1.2-a/PATCHES 2013-09-26 10:56:55.000000000 +0000
53 +++ mpfr-3.1.2-b/PATCHES 2013-09-26 10:56:55.000000000 +0000
56 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
57 --- mpfr-3.1.2-a/VERSION 2013-09-26 10:52:52.000000000 +0000
58 +++ mpfr-3.1.2-b/VERSION 2013-09-26 10:56:55.000000000 +0000
62 diff -Naurd mpfr-3.1.2-a/src/fits_u.h mpfr-3.1.2-b/src/fits_u.h
63 --- mpfr-3.1.2-a/src/fits_u.h 2013-03-13 15:37:35.000000000 +0000
64 +++ mpfr-3.1.2-b/src/fits_u.h 2013-09-26 10:56:55.000000000 +0000
68 if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (f)))
69 - /* Zero always fit */
70 - return MPFR_IS_ZERO (f) ? 1 : 0;
71 - else if (MPFR_IS_NEG (f))
72 - /* Negative numbers don't fit */
76 - (b) round(f, prec(slong), rnd) <= MAXIMUM */
77 + return MPFR_IS_ZERO (f) ? 1 : 0; /* Zero always fits */
81 + if (MPFR_IS_NEG (f))
82 + return e >= 1 ? 0 /* f <= -1 does not fit */
83 + : rnd != MPFR_RNDN ? MPFR_IS_LIKE_RNDU (rnd, -1) /* directed mode */
84 + : e < 0 ? 1 /* f > -1/2 fits in MPFR_RNDN */
85 + : mpfr_powerof2_raw(f); /* -1/2 fits, -1 < f < -1/2 don't */
89 + (b) round(f, prec(slong), rnd) <= MAXIMUM */
91 /* first compute prec(MAXIMUM); fits in an int */
92 for (s = MAXIMUM, prec = 0; s != 0; s /= 2, prec ++);
94 diff -Naurd mpfr-3.1.2-a/src/fits_uintmax.c mpfr-3.1.2-b/src/fits_uintmax.c
95 --- mpfr-3.1.2-a/src/fits_uintmax.c 2013-03-13 15:37:33.000000000 +0000
96 +++ mpfr-3.1.2-b/src/fits_uintmax.c 2013-09-26 10:56:55.000000000 +0000
98 #include "mpfr-intmax.h"
99 #include "mpfr-impl.h"
101 -#ifdef _MPFR_H_HAVE_INTMAX_T
103 -/* We can't use fits_u.h <= mpfr_cmp_ui */
105 -mpfr_fits_uintmax_p (mpfr_srcptr f, mpfr_rnd_t rnd)
113 - if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (f)))
114 - /* Zero always fit */
115 - return MPFR_IS_ZERO (f) ? 1 : 0;
116 - else if (MPFR_IS_NEG (f))
117 - /* Negative numbers don't fit */
121 - (b) round(f, prec(slong), rnd) <= MAXIMUM */
123 - e = MPFR_GET_EXP (f);
125 - /* first compute prec(MAXIMUM); fits in an int */
126 - for (s = MPFR_UINTMAX_MAX, prec = 0; s != 0; s /= 2, prec ++);
128 - /* MAXIMUM needs prec bits, i.e. MAXIMUM = 2^prec - 1 */
130 - /* if e <= prec - 1, then f < 2^(prec-1) < MAXIMUM */
133 +/* Note: though mpfr-impl.h is included in fits_u.h, we also include it
134 + above so that it gets included even when _MPFR_H_HAVE_INTMAX_T is not
135 + defined; this is necessary to avoid an empty translation unit, which
136 + is forbidden by ISO C. Without this, a failing test can be reproduced
137 + by creating an invalid stdint.h somewhere in the default include path
138 + and by compiling MPFR with "gcc -ansi -pedantic-errors". */
140 - /* if e >= prec + 1, then f >= 2^prec > MAXIMUM */
143 +#ifdef _MPFR_H_HAVE_INTMAX_T
145 - MPFR_ASSERTD (e == prec);
146 +#define FUNCTION mpfr_fits_uintmax_p
147 +#define MAXIMUM MPFR_UINTMAX_MAX
148 +#define TYPE uintmax_t
150 - /* hard case: first round to prec bits, then check */
151 - mpfr_init2 (x, prec);
152 - mpfr_set (x, f, rnd);
153 - res = MPFR_GET_EXP (x) == e;
160 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
161 --- mpfr-3.1.2-a/src/mpfr.h 2013-09-26 10:52:52.000000000 +0000
162 +++ mpfr-3.1.2-b/src/mpfr.h 2013-09-26 10:56:55.000000000 +0000
164 #define MPFR_VERSION_MAJOR 3
165 #define MPFR_VERSION_MINOR 1
166 #define MPFR_VERSION_PATCHLEVEL 2
167 -#define MPFR_VERSION_STRING "3.1.2-p1"
168 +#define MPFR_VERSION_STRING "3.1.2-p2"
170 /* Macros dealing with MPFR VERSION */
171 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
172 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
173 --- mpfr-3.1.2-a/src/version.c 2013-09-26 10:52:52.000000000 +0000
174 +++ mpfr-3.1.2-b/src/version.c 2013-09-26 10:56:55.000000000 +0000
177 mpfr_get_version (void)
182 diff -Naurd mpfr-3.1.2-a/tests/tfits.c mpfr-3.1.2-b/tests/tfits.c
183 --- mpfr-3.1.2-a/tests/tfits.c 2013-03-13 15:37:45.000000000 +0000
184 +++ mpfr-3.1.2-b/tests/tfits.c 2013-09-26 10:56:55.000000000 +0000
185 @@ -33,155 +33,176 @@
186 #include "mpfr-intmax.h"
187 #include "mpfr-test.h"
189 -#define ERROR1 { printf("Initial error for x="); mpfr_dump(x); exit(1); }
190 -#define ERROR2 { printf("Error for x="); mpfr_dump(x); exit(1); }
194 + printf("Error %d for rnd = %s and x = ", N, \
195 + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); \
201 static void check_intmax (void);
217 - if (mpfr_fits_ulong_p (x, MPFR_RNDN))
219 - if (mpfr_fits_slong_p (x, MPFR_RNDN))
221 - if (mpfr_fits_uint_p (x, MPFR_RNDN))
223 - if (mpfr_fits_sint_p (x, MPFR_RNDN))
225 - if (mpfr_fits_ushort_p (x, MPFR_RNDN))
227 - if (mpfr_fits_sshort_p (x, MPFR_RNDN))
233 - mpfr_set_inf (x, 1);
234 - if (mpfr_fits_ulong_p (x, MPFR_RNDN))
236 - if (mpfr_fits_slong_p (x, MPFR_RNDN))
238 - if (mpfr_fits_uint_p (x, MPFR_RNDN))
240 - if (mpfr_fits_sint_p (x, MPFR_RNDN))
242 - if (mpfr_fits_ushort_p (x, MPFR_RNDN))
244 - if (mpfr_fits_sshort_p (x, MPFR_RNDN))
248 + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
250 + if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
252 + if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
254 + if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
256 + if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
258 + if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
263 - if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
265 - if (!mpfr_fits_slong_p (x, MPFR_RNDN))
267 - if (!mpfr_fits_uint_p (x, MPFR_RNDN))
269 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
271 - if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
273 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
276 + mpfr_set_inf (x, 1);
277 + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
279 + if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
281 + if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
283 + if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
285 + if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
287 + if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
290 - /* Check small op */
291 - mpfr_set_str1 (x, "1@-1");
292 - if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
294 - if (!mpfr_fits_slong_p (x, MPFR_RNDN))
296 - if (!mpfr_fits_uint_p (x, MPFR_RNDN))
298 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
300 - if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
302 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
306 + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
308 + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
310 + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
312 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
314 + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
316 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
320 - mpfr_set_ui (x, 17, MPFR_RNDN);
321 - if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
323 - if (!mpfr_fits_slong_p (x, MPFR_RNDN))
325 - if (!mpfr_fits_uint_p (x, MPFR_RNDN))
327 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
329 - if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
331 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
333 + /* Check small positive op */
334 + mpfr_set_str1 (x, "1@-1");
335 + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
337 + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
339 + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
341 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
343 + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
345 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
348 - /* Check all other values */
349 - mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
350 - mpfr_mul_2exp (x, x, 1, MPFR_RNDN);
351 - if (mpfr_fits_ulong_p (x, MPFR_RNDN))
353 - if (mpfr_fits_slong_p (x, MPFR_RNDN))
355 - mpfr_mul_2exp (x, x, 40, MPFR_RNDN);
356 - if (mpfr_fits_ulong_p (x, MPFR_RNDN))
358 - if (mpfr_fits_uint_p (x, MPFR_RNDN))
360 - if (mpfr_fits_sint_p (x, MPFR_RNDN))
362 - if (mpfr_fits_ushort_p (x, MPFR_RNDN))
364 - if (mpfr_fits_sshort_p (x, MPFR_RNDN))
367 + mpfr_set_ui (x, 17, MPFR_RNDN);
368 + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
370 + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
372 + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
374 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
376 + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
378 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
381 - mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
382 - if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
384 - mpfr_set_ui (x, LONG_MAX, MPFR_RNDN);
385 - if (!mpfr_fits_slong_p (x, MPFR_RNDN))
387 - mpfr_set_ui (x, UINT_MAX, MPFR_RNDN);
388 - if (!mpfr_fits_uint_p (x, MPFR_RNDN))
390 - mpfr_set_ui (x, INT_MAX, MPFR_RNDN);
391 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
393 - mpfr_set_ui (x, USHRT_MAX, MPFR_RNDN);
394 - if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
396 - mpfr_set_ui (x, SHRT_MAX, MPFR_RNDN);
397 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
399 + /* Check all other values */
400 + mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
401 + mpfr_mul_2exp (x, x, 1, MPFR_RNDN);
402 + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
404 + if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
406 + mpfr_mul_2exp (x, x, 40, MPFR_RNDN);
407 + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
409 + if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
411 + if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
413 + if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
415 + if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
418 - mpfr_set_si (x, 1, MPFR_RNDN);
419 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
421 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
423 + mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
424 + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
426 + mpfr_set_ui (x, LONG_MAX, MPFR_RNDN);
427 + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
429 + mpfr_set_ui (x, UINT_MAX, MPFR_RNDN);
430 + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
432 + mpfr_set_ui (x, INT_MAX, MPFR_RNDN);
433 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
435 + mpfr_set_ui (x, USHRT_MAX, MPFR_RNDN);
436 + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
438 + mpfr_set_ui (x, SHRT_MAX, MPFR_RNDN);
439 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
442 - /* Check negative value */
443 - mpfr_set_si (x, -1, MPFR_RNDN);
444 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
446 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
448 - if (!mpfr_fits_slong_p (x, MPFR_RNDN))
450 - if (mpfr_fits_uint_p (x, MPFR_RNDN))
452 - if (mpfr_fits_ushort_p (x, MPFR_RNDN))
454 - if (mpfr_fits_ulong_p (x, MPFR_RNDN))
456 + mpfr_set_si (x, 1, MPFR_RNDN);
457 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
459 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
462 + /* Check negative op */
463 + for (i = 1; i <= 4; i++)
467 + mpfr_set_si_2exp (x, -i, -2, MPFR_RNDN);
468 + mpfr_rint (y, x, (mpfr_rnd_t) r);
469 + inv = MPFR_NOTZERO (y);
470 + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r) ^ inv)
472 + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
474 + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r) ^ inv)
476 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
478 + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r) ^ inv)
480 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
490 @@ -189,85 +210,98 @@
494 -static void check_intmax (void)
498 #ifdef _MPFR_H_HAVE_INTMAX_T
503 - mpfr_init2 (x, sizeof (uintmax_t)*CHAR_BIT);
504 + mpfr_init2 (x, sizeof (uintmax_t) * CHAR_BIT);
509 - if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
511 - if (mpfr_fits_intmax_p (x, MPFR_RNDN))
517 + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
519 + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
523 - mpfr_set_inf (x, 1);
524 - if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
526 - if (mpfr_fits_intmax_p (x, MPFR_RNDN))
529 + mpfr_set_inf (x, 1);
530 + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
532 + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
537 - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
539 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
543 + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
545 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
548 - /* Check small op */
549 - mpfr_set_str1 (x, "1@-1");
550 - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
552 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
554 + /* Check positive small op */
555 + mpfr_set_str1 (x, "1@-1");
556 + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
558 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
562 - mpfr_set_ui (x, 17, MPFR_RNDN);
563 - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
565 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
568 + mpfr_set_ui (x, 17, MPFR_RNDN);
569 + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
571 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
575 - mpfr_set_ui_2exp (x, 42, sizeof (uintmax_t) * 32, MPFR_RNDN);
576 - if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
578 - if (mpfr_fits_intmax_p (x, MPFR_RNDN))
581 + mpfr_set_ui_2exp (x, 42, sizeof (uintmax_t) * 32, MPFR_RNDN);
582 + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
584 + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
587 - /* Check all other values */
588 - mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
589 - mpfr_add_ui (x, x, 1, MPFR_RNDN);
590 - if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
592 - mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
593 - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
595 - mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
596 - mpfr_add_ui (x, x, 1, MPFR_RNDN);
597 - if (mpfr_fits_intmax_p (x, MPFR_RNDN))
599 - mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
600 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
602 - mpfr_set_sj (x, MPFR_INTMAX_MIN, MPFR_RNDN);
603 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
605 - mpfr_sub_ui (x, x, 1, MPFR_RNDN);
606 - if (mpfr_fits_intmax_p (x, MPFR_RNDN))
608 + /* Check all other values */
609 + mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
610 + mpfr_add_ui (x, x, 1, MPFR_RNDN);
611 + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
613 + mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
614 + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
616 + mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
617 + mpfr_add_ui (x, x, 1, MPFR_RNDN);
618 + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
620 + mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
621 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
623 + mpfr_set_sj (x, MPFR_INTMAX_MIN, MPFR_RNDN);
624 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
626 + mpfr_sub_ui (x, x, 1, MPFR_RNDN);
627 + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
630 - /* Check negative value */
631 - mpfr_set_si (x, -1, MPFR_RNDN);
632 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
634 - if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
636 + /* Check negative op */
637 + for (i = 1; i <= 4; i++)
641 + mpfr_set_si_2exp (x, -i, -2, MPFR_RNDN);
642 + mpfr_rint (y, x, (mpfr_rnd_t) r);
643 + inv = MPFR_NOTZERO (y);
644 + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r) ^ inv)
646 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
656 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
657 --- mpfr-3.1.2-a/PATCHES 2013-10-09 13:34:21.000000000 +0000
658 +++ mpfr-3.1.2-b/PATCHES 2013-10-09 13:34:21.000000000 +0000
661 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
662 --- mpfr-3.1.2-a/VERSION 2013-09-26 10:52:52.000000000 +0000
663 +++ mpfr-3.1.2-b/VERSION 2013-10-09 13:34:21.000000000 +0000
667 diff -Naurd mpfr-3.1.2-a/src/mpfr-impl.h mpfr-3.1.2-b/src/mpfr-impl.h
668 --- mpfr-3.1.2-a/src/mpfr-impl.h 2013-03-13 15:37:36.000000000 +0000
669 +++ mpfr-3.1.2-b/src/mpfr-impl.h 2013-10-09 13:34:21.000000000 +0000
671 #define MPFR_LIMBS_PER_FLT ((IEEE_FLT_MANT_DIG-1)/GMP_NUMB_BITS+1)
673 /* Visual C++ doesn't support +1.0/0.0, -1.0/0.0 and 0.0/0.0
674 - at compile time. */
675 -#if defined(_MSC_VER) && defined(_WIN32) && (_MSC_VER >= 1200)
677 + Clang with -fsanitize=undefined is a bit similar due to a bug:
678 + http://llvm.org/bugs/show_bug.cgi?id=17381
679 + but even without its sanitizer, it may be better to use the
680 + double_zero version until IEEE 754 division by zero is properly
682 + http://llvm.org/bugs/show_bug.cgi?id=17000
684 +#if (defined(_MSC_VER) && defined(_WIN32) && (_MSC_VER >= 1200)) || \
686 static double double_zero = 0.0;
687 # define DBL_NAN (double_zero/double_zero)
688 # define DBL_POS_INF ((double) 1.0/double_zero)
690 (with Xcode 2.4.1, i.e. the latest one). */
691 #define LVALUE(x) (&(x) == &(x) || &(x) != &(x))
692 #define DOUBLE_ISINF(x) (LVALUE(x) && ((x) > DBL_MAX || (x) < -DBL_MAX))
693 +/* The DOUBLE_ISNAN(x) macro is also valid on long double x
694 + (assuming that the compiler isn't too broken). */
696 /* Avoid MIPSpro / IRIX64 / gcc -ffast-math (incorrect) optimizations.
697 The + must not be replaced by a ||. With gcc -ffast-math, NaN is
698 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
699 --- mpfr-3.1.2-a/src/mpfr.h 2013-09-26 10:52:52.000000000 +0000
700 +++ mpfr-3.1.2-b/src/mpfr.h 2013-10-09 13:34:21.000000000 +0000
702 #define MPFR_VERSION_MAJOR 3
703 #define MPFR_VERSION_MINOR 1
704 #define MPFR_VERSION_PATCHLEVEL 2
705 -#define MPFR_VERSION_STRING "3.1.2-p2"
706 +#define MPFR_VERSION_STRING "3.1.2-p3"
708 /* Macros dealing with MPFR VERSION */
709 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
710 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
711 --- mpfr-3.1.2-a/src/version.c 2013-09-26 10:52:52.000000000 +0000
712 +++ mpfr-3.1.2-b/src/version.c 2013-10-09 13:34:21.000000000 +0000
715 mpfr_get_version (void)
720 diff -Naurd mpfr-3.1.2-a/tests/tget_flt.c mpfr-3.1.2-b/tests/tget_flt.c
721 --- mpfr-3.1.2-a/tests/tget_flt.c 2013-03-13 15:37:44.000000000 +0000
722 +++ mpfr-3.1.2-b/tests/tget_flt.c 2013-10-09 13:34:21.000000000 +0000
730 +#if !defined(MPFR_ERRDIVZERO)
734 + tests_start_mpfr ();
736 +#if !defined(MPFR_ERRDIVZERO)
737 + /* The definition of DBL_POS_INF involves a division by 0. This makes
738 + "clang -O2 -fsanitize=undefined -fno-sanitize-recover" fail. */
739 infp = (float) DBL_POS_INF;
740 if (infp * 0.5 != infp)
743 fprintf (stderr, "(this is probably a compiler bug, please report)\n");
747 - tests_start_mpfr ();
753 printf ("expected %.8e, got %.8e\n", g, f);
756 +#if !defined(MPFR_ERRDIVZERO)
757 f = mpfr_get_flt (x, MPFR_RNDN); /* first round to 2^128 (even rule),
758 thus we should get +Inf */
761 printf ("expected %.8e, got %.8e\n", g, f);
768 diff -Naurd mpfr-3.1.2-a/tests/tset_ld.c mpfr-3.1.2-b/tests/tset_ld.c
769 --- mpfr-3.1.2-a/tests/tset_ld.c 2013-03-13 15:37:44.000000000 +0000
770 +++ mpfr-3.1.2-b/tests/tset_ld.c 2013-10-09 13:34:21.000000000 +0000
773 Isnan_ld (long double d)
775 - double e = (double) d;
776 - if (DOUBLE_ISNAN (e))
777 + /* Do not convert d to double as this can give an overflow, which
778 + may confuse compilers without IEEE 754 support (such as clang
779 + -fsanitize=undefined), or trigger a trap if enabled.
780 + The DOUBLE_ISNAN macro should work fine on long double. */
781 + if (DOUBLE_ISNAN (d))
783 LONGDOUBLE_NAN_ACTION (d, goto yes);
785 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
786 --- mpfr-3.1.2-a/PATCHES 2013-11-15 00:51:49.211333830 +0000
787 +++ mpfr-3.1.2-b/PATCHES 2013-11-15 00:51:49.323334999 +0000
790 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
791 --- mpfr-3.1.2-a/VERSION 2013-11-15 00:51:49.211333830 +0000
792 +++ mpfr-3.1.2-b/VERSION 2013-11-15 00:51:49.323334999 +0000
796 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
797 --- mpfr-3.1.2-a/src/mpfr.h 2013-11-15 00:51:49.211333830 +0000
798 +++ mpfr-3.1.2-b/src/mpfr.h 2013-11-15 00:51:49.323334999 +0000
800 #define MPFR_VERSION_MAJOR 3
801 #define MPFR_VERSION_MINOR 1
802 #define MPFR_VERSION_PATCHLEVEL 2
803 -#define MPFR_VERSION_STRING "3.1.2-p3"
804 +#define MPFR_VERSION_STRING "3.1.2-p4"
806 /* Macros dealing with MPFR VERSION */
807 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
808 diff -Naurd mpfr-3.1.2-a/src/vasprintf.c mpfr-3.1.2-b/src/vasprintf.c
809 --- mpfr-3.1.2-a/src/vasprintf.c 2013-03-13 15:37:37.000000000 +0000
810 +++ mpfr-3.1.2-b/src/vasprintf.c 2013-11-15 00:51:49.267334408 +0000
811 @@ -1040,7 +1040,7 @@
814 /* Determine the different parts of the string representation of the regular
815 - number P when SPEC.SPEC is 'e', 'E', 'g', or 'G'.
816 + number P when spec.spec is 'e', 'E', 'g', or 'G'.
817 DEC_INFO contains the previously computed exponent and string or is NULL.
819 return -1 if some field > INT_MAX */
820 @@ -1167,7 +1167,7 @@
823 /* Determine the different parts of the string representation of the regular
824 - number P when SPEC.SPEC is 'f', 'F', 'g', or 'G'.
825 + number P when spec.spec is 'f', 'F', 'g', or 'G'.
826 DEC_INFO contains the previously computed exponent and string or is NULL.
828 return -1 if some field of number_parts is greater than INT_MAX */
829 @@ -1559,7 +1559,7 @@
830 /* fractional part */
832 np->point = MPFR_DECIMAL_POINT;
833 - np->fp_trailing_zeros = (spec.spec == 'g' && spec.spec == 'G') ?
834 + np->fp_trailing_zeros = (spec.spec == 'g' || spec.spec == 'G') ?
835 spec.prec - 1 : spec.prec;
838 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
839 --- mpfr-3.1.2-a/src/version.c 2013-11-15 00:51:49.211333830 +0000
840 +++ mpfr-3.1.2-b/src/version.c 2013-11-15 00:51:49.323334999 +0000
843 mpfr_get_version (void)
848 diff -Naurd mpfr-3.1.2-a/tests/tsprintf.c mpfr-3.1.2-b/tests/tsprintf.c
849 --- mpfr-3.1.2-a/tests/tsprintf.c 2013-03-13 15:37:44.000000000 +0000
850 +++ mpfr-3.1.2-b/tests/tsprintf.c 2013-11-15 00:51:49.267334408 +0000
851 @@ -456,10 +456,16 @@
852 check_sprintf ("1.999900 ", "%-#10.7RG", x);
853 check_sprintf ("1.9999 ", "%-10.7RG", x);
854 mpfr_set_ui (x, 1, MPFR_RNDN);
855 + check_sprintf ("1.", "%#.1Rg", x);
856 + check_sprintf ("1. ", "%-#5.1Rg", x);
857 + check_sprintf (" 1.0", "%#5.2Rg", x);
858 check_sprintf ("1.00000000000000000000000000000", "%#.30Rg", x);
859 check_sprintf ("1", "%.30Rg", x);
860 mpfr_set_ui (x, 0, MPFR_RNDN);
861 - check_sprintf ("0.000000000000000000000000000000", "%#.30Rg", x);
862 + check_sprintf ("0.", "%#.1Rg", x);
863 + check_sprintf ("0. ", "%-#5.1Rg", x);
864 + check_sprintf (" 0.0", "%#5.2Rg", x);
865 + check_sprintf ("0.00000000000000000000000000000", "%#.30Rg", x);
866 check_sprintf ("0", "%.30Rg", x);
868 /* following tests with precision 53 bits */
869 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
870 --- mpfr-3.1.2-a/PATCHES 2013-12-01 11:07:49.575329762 +0000
871 +++ mpfr-3.1.2-b/PATCHES 2013-12-01 11:07:49.751331625 +0000
874 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
875 --- mpfr-3.1.2-a/VERSION 2013-12-01 11:07:49.571329714 +0000
876 +++ mpfr-3.1.2-b/VERSION 2013-12-01 11:07:49.747331585 +0000
880 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
881 --- mpfr-3.1.2-a/src/mpfr.h 2013-12-01 11:07:49.571329714 +0000
882 +++ mpfr-3.1.2-b/src/mpfr.h 2013-12-01 11:07:49.747331585 +0000
884 #define MPFR_VERSION_MAJOR 3
885 #define MPFR_VERSION_MINOR 1
886 #define MPFR_VERSION_PATCHLEVEL 2
887 -#define MPFR_VERSION_STRING "3.1.2-p4"
888 +#define MPFR_VERSION_STRING "3.1.2-p5"
890 /* Macros dealing with MPFR VERSION */
891 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
893 _t = (mpfr_kind_t) _k; \
896 - _t = (mpfr_kind_t) -k; \
897 + _t = (mpfr_kind_t) - _k; \
900 _e = _t == MPFR_REGULAR_KIND ? (e) : \
901 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
902 --- mpfr-3.1.2-a/src/version.c 2013-12-01 11:07:49.575329762 +0000
903 +++ mpfr-3.1.2-b/src/version.c 2013-12-01 11:07:49.747331585 +0000
906 mpfr_get_version (void)
911 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
912 --- mpfr-3.1.2-a/PATCHES 2014-04-15 21:56:49.609057464 +0000
913 +++ mpfr-3.1.2-b/PATCHES 2014-04-15 21:56:49.697059857 +0000
916 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
917 --- mpfr-3.1.2-a/VERSION 2014-04-15 21:56:49.609057464 +0000
918 +++ mpfr-3.1.2-b/VERSION 2014-04-15 21:56:49.697059857 +0000
922 diff -Naurd mpfr-3.1.2-a/src/li2.c mpfr-3.1.2-b/src/li2.c
923 --- mpfr-3.1.2-a/src/li2.c 2013-03-13 15:37:32.000000000 +0000
924 +++ mpfr-3.1.2-b/src/li2.c 2014-04-15 21:56:49.653058661 +0000
926 return mpfr_check_range (y, inexact, rnd_mode);
929 - MPFR_ASSERTN (0); /* should never reach this point */
930 + MPFR_RET_NEVER_GO_HERE ();
932 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
933 --- mpfr-3.1.2-a/src/mpfr.h 2014-04-15 21:56:49.609057464 +0000
934 +++ mpfr-3.1.2-b/src/mpfr.h 2014-04-15 21:56:49.697059857 +0000
936 #define MPFR_VERSION_MAJOR 3
937 #define MPFR_VERSION_MINOR 1
938 #define MPFR_VERSION_PATCHLEVEL 2
939 -#define MPFR_VERSION_STRING "3.1.2-p5"
940 +#define MPFR_VERSION_STRING "3.1.2-p6"
942 /* Macros dealing with MPFR VERSION */
943 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
944 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
945 --- mpfr-3.1.2-a/src/version.c 2014-04-15 21:56:49.609057464 +0000
946 +++ mpfr-3.1.2-b/src/version.c 2014-04-15 21:56:49.697059857 +0000
949 mpfr_get_version (void)
954 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
955 --- mpfr-3.1.2-a/PATCHES 2014-04-15 22:04:57.090286262 +0000
956 +++ mpfr-3.1.2-b/PATCHES 2014-04-15 22:04:57.162288198 +0000
959 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
960 --- mpfr-3.1.2-a/VERSION 2014-04-15 22:04:57.086286154 +0000
961 +++ mpfr-3.1.2-b/VERSION 2014-04-15 22:04:57.162288198 +0000
965 diff -Naurd mpfr-3.1.2-a/src/exp3.c mpfr-3.1.2-b/src/exp3.c
966 --- mpfr-3.1.2-a/src/exp3.c 2013-03-13 15:37:34.000000000 +0000
967 +++ mpfr-3.1.2-b/src/exp3.c 2014-04-15 22:04:57.126287230 +0000
972 - if (mpfr_can_round (shift_x > 0 ? t : tmp, realprec, MPFR_RNDD, MPFR_RNDZ,
973 + if (mpfr_can_round (shift_x > 0 ? t : tmp, realprec, MPFR_RNDN, MPFR_RNDZ,
974 MPFR_PREC(y) + (rnd_mode == MPFR_RNDN)))
976 inexact = mpfr_set (y, shift_x > 0 ? t : tmp, rnd_mode);
977 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
978 --- mpfr-3.1.2-a/src/mpfr.h 2014-04-15 22:04:57.086286154 +0000
979 +++ mpfr-3.1.2-b/src/mpfr.h 2014-04-15 22:04:57.162288198 +0000
981 #define MPFR_VERSION_MAJOR 3
982 #define MPFR_VERSION_MINOR 1
983 #define MPFR_VERSION_PATCHLEVEL 2
984 -#define MPFR_VERSION_STRING "3.1.2-p6"
985 +#define MPFR_VERSION_STRING "3.1.2-p7"
987 /* Macros dealing with MPFR VERSION */
988 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
989 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
990 --- mpfr-3.1.2-a/src/version.c 2014-04-15 22:04:57.090286262 +0000
991 +++ mpfr-3.1.2-b/src/version.c 2014-04-15 22:04:57.162288198 +0000
994 mpfr_get_version (void)
999 diff -Naurd mpfr-3.1.2-a/tests/texp.c mpfr-3.1.2-b/tests/texp.c
1000 --- mpfr-3.1.2-a/tests/texp.c 2013-03-13 15:37:44.000000000 +0000
1001 +++ mpfr-3.1.2-b/tests/texp.c 2014-04-15 22:04:57.126287230 +0000
1002 @@ -150,6 +150,22 @@
1006 + mpfr_set_prec (x, 118);
1007 + mpfr_set_str_binary (x, "0.1110010100011101010000111110011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E-86");
1008 + mpfr_set_prec (y, 118);
1009 + mpfr_exp_2 (y, x, MPFR_RNDU);
1010 + mpfr_exp_3 (x, x, MPFR_RNDU);
1011 + if (mpfr_cmp (x, y))
1013 + printf ("mpfr_exp_2 and mpfr_exp_3 differ for prec=118\n");
1014 + printf ("mpfr_exp_2 gives ");
1015 + mpfr_out_str (stdout, 2, 0, y, MPFR_RNDN);
1016 + printf ("\nmpfr_exp_3 gives ");
1017 + mpfr_out_str (stdout, 2, 0, x, MPFR_RNDN);
1025 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
1026 --- mpfr-3.1.2-a/PATCHES 2014-04-15 22:20:32.243481506 +0000
1027 +++ mpfr-3.1.2-b/PATCHES 2014-04-15 22:22:32.418722707 +0000
1030 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
1031 --- mpfr-3.1.2-a/VERSION 2014-04-15 22:20:20.755171478 +0000
1032 +++ mpfr-3.1.2-b/VERSION 2014-04-15 22:21:45.225450147 +0000
1036 diff -Naurd mpfr-3.1.2-a/configure mpfr-3.1.2-b/configure
1037 --- mpfr-3.1.2-a/configure 2013-03-13 15:38:20.000000000 +0000
1038 +++ mpfr-3.1.2-b/configure 2014-04-15 22:21:38.821277476 +0000
1039 @@ -14545,26 +14545,30 @@
1040 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1043 -if test "$use_gmp_build" = yes ; then
1044 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for valid GMP_NUMB_BITS" >&5
1045 -$as_echo_n "checking for valid GMP_NUMB_BITS... " >&6; }
1046 - if test "$cross_compiling" = yes; then :
1047 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMP_NUMB_BITS and sizeof(mp_limb_t) consistency" >&5
1048 +$as_echo_n "checking for GMP_NUMB_BITS and sizeof(mp_limb_t) consistency... " >&6; }
1049 +if test "$cross_compiling" = yes; then :
1050 { $as_echo "$as_me:${as_lineno-$LINENO}: result: can't test" >&5
1051 $as_echo "can't test" >&6; }
1053 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1054 /* end confdefs.h. */
1059 -#include "gmp-impl.h"
1065 - return GMP_NUMB_BITS == BYTES_PER_MP_LIMB * CHAR_BIT
1066 - && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB ? 0 : 1;
1067 + if (GMP_NUMB_BITS == sizeof(mp_limb_t) * CHAR_BIT)
1069 + fprintf (stderr, "GMP_NUMB_BITS = %ld\n", (long) GMP_NUMB_BITS);
1070 + fprintf (stderr, "sizeof(mp_limb_t) = %ld\n", (long) sizeof(mp_limb_t));
1071 + fprintf (stderr, "sizeof(mp_limb_t) * CHAR_BIT = %ld != GMP_NUMB_BITS\n",
1072 + (long) (sizeof(mp_limb_t) * CHAR_BIT));
1077 @@ -14577,14 +14581,14 @@
1079 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1080 $as_echo "no" >&6; }
1081 - as_fn_error $? "GMP_NUMB_BITS is incorrect.
1082 -You probably need to change some of the GMP or MPFR compile options." "$LINENO" 5
1083 + as_fn_error $? "GMP_NUMB_BITS and sizeof(mp_limb_t) are not consistent.
1084 +You probably need to change some of the GMP or MPFR compile options.
1085 +See 'config.log' for details (search for GMP_NUMB_BITS)." "$LINENO" 5
1087 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
1088 conftest.$ac_objext conftest.beam conftest.$ac_ext
1094 if test "$dont_link_with_gmp" = yes ; then
1095 diff -Naurd mpfr-3.1.2-a/configure.ac mpfr-3.1.2-b/configure.ac
1096 --- mpfr-3.1.2-a/configure.ac 2013-03-13 15:37:46.000000000 +0000
1097 +++ mpfr-3.1.2-b/configure.ac 2013-03-13 15:37:46.000000000 +0000
1098 @@ -435,23 +435,29 @@
1102 -dnl Check for valid GMP_NUMB_BITS and BYTES_PER_MP_LIMB
1103 +dnl Check for GMP_NUMB_BITS and sizeof(mp_limb_t) consistency.
1104 +dnl Problems may occur if gmp.h was generated with some ABI
1105 +dnl and is used with another ABI (or if nails are used).
1106 dnl This test doesn't need to link with libgmp (at least it shouldn't).
1107 -if test "$use_gmp_build" = yes ; then
1108 - AC_MSG_CHECKING(for valid GMP_NUMB_BITS)
1109 - AC_RUN_IFELSE([AC_LANG_PROGRAM([[
1110 +AC_MSG_CHECKING(for GMP_NUMB_BITS and sizeof(mp_limb_t) consistency)
1111 +AC_RUN_IFELSE([AC_LANG_PROGRAM([[
1115 -#include "gmp-impl.h"
1117 - return GMP_NUMB_BITS == BYTES_PER_MP_LIMB * CHAR_BIT
1118 - && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB ? 0 : 1;
1119 + if (GMP_NUMB_BITS == sizeof(mp_limb_t) * CHAR_BIT)
1121 + fprintf (stderr, "GMP_NUMB_BITS = %ld\n", (long) GMP_NUMB_BITS);
1122 + fprintf (stderr, "sizeof(mp_limb_t) = %ld\n", (long) sizeof(mp_limb_t));
1123 + fprintf (stderr, "sizeof(mp_limb_t) * CHAR_BIT = %ld != GMP_NUMB_BITS\n",
1124 + (long) (sizeof(mp_limb_t) * CHAR_BIT));
1126 ]])], [AC_MSG_RESULT(yes)], [
1128 - AC_MSG_ERROR([GMP_NUMB_BITS is incorrect.
1129 -You probably need to change some of the GMP or MPFR compile options.])],
1130 + AC_MSG_ERROR([GMP_NUMB_BITS and sizeof(mp_limb_t) are not consistent.
1131 +You probably need to change some of the GMP or MPFR compile options.
1132 +See 'config.log' for details (search for GMP_NUMB_BITS).])],
1133 [AC_MSG_RESULT([can't test])])
1137 dnl We really need to link using libtool. But it is impossible with the current
1138 diff -Naurd mpfr-3.1.2-a/src/init2.c mpfr-3.1.2-b/src/init2.c
1139 --- mpfr-3.1.2-a/src/init2.c 2013-03-13 15:37:32.000000000 +0000
1140 +++ mpfr-3.1.2-b/src/init2.c 2014-04-15 22:21:06.220398489 +0000
1143 /* Check if we can represent the number of limbs
1144 * associated to the maximum of mpfr_prec_t*/
1145 - MPFR_ASSERTN( MP_SIZE_T_MAX >= (MPFR_PREC_MAX/BYTES_PER_MP_LIMB) );
1146 + MPFR_ASSERTN( MP_SIZE_T_MAX >= (MPFR_PREC_MAX/MPFR_BYTES_PER_MP_LIMB) );
1148 - /* Check for correct GMP_NUMB_BITS and BYTES_PER_MP_LIMB */
1149 - MPFR_ASSERTN( GMP_NUMB_BITS == BYTES_PER_MP_LIMB * CHAR_BIT
1150 - && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB );
1151 + /* Check for correct GMP_NUMB_BITS and MPFR_BYTES_PER_MP_LIMB */
1152 + MPFR_ASSERTN( GMP_NUMB_BITS == MPFR_BYTES_PER_MP_LIMB * CHAR_BIT
1153 + && sizeof(mp_limb_t) == MPFR_BYTES_PER_MP_LIMB );
1155 MPFR_ASSERTN (mp_bits_per_limb == GMP_NUMB_BITS);
1157 diff -Naurd mpfr-3.1.2-a/src/mpfr-gmp.h mpfr-3.1.2-b/src/mpfr-gmp.h
1158 --- mpfr-3.1.2-a/src/mpfr-gmp.h 2013-03-13 15:37:32.000000000 +0000
1159 +++ mpfr-3.1.2-b/src/mpfr-gmp.h 2014-04-15 22:21:06.220398489 +0000
1163 /* Define some macros */
1164 -#define BYTES_PER_MP_LIMB (GMP_NUMB_BITS/CHAR_BIT)
1166 #define MP_LIMB_T_MAX (~(mp_limb_t)0)
1169 #define SHRT_HIGHBIT SHRT_MIN
1171 /* MP_LIMB macros */
1172 -#define MPN_ZERO(dst, n) memset((dst), 0, (n)*BYTES_PER_MP_LIMB)
1173 -#define MPN_COPY_DECR(dst,src,n) memmove((dst),(src),(n)*BYTES_PER_MP_LIMB)
1174 -#define MPN_COPY_INCR(dst,src,n) memmove((dst),(src),(n)*BYTES_PER_MP_LIMB)
1175 +#define MPN_ZERO(dst, n) memset((dst), 0, (n)*MPFR_BYTES_PER_MP_LIMB)
1176 +#define MPN_COPY_DECR(dst,src,n) memmove((dst),(src),(n)*MPFR_BYTES_PER_MP_LIMB)
1177 +#define MPN_COPY_INCR(dst,src,n) memmove((dst),(src),(n)*MPFR_BYTES_PER_MP_LIMB)
1178 #define MPN_COPY(dst,src,n) \
1181 if ((dst) != (src)) \
1183 MPFR_ASSERTD ((char *) (dst) >= (char *) (src) + \
1184 - (n) * BYTES_PER_MP_LIMB || \
1185 + (n) * MPFR_BYTES_PER_MP_LIMB || \
1186 (char *) (src) >= (char *) (dst) + \
1187 - (n) * BYTES_PER_MP_LIMB); \
1188 - memcpy ((dst), (src), (n) * BYTES_PER_MP_LIMB); \
1189 + (n) * MPFR_BYTES_PER_MP_LIMB); \
1190 + memcpy ((dst), (src), (n) * MPFR_BYTES_PER_MP_LIMB); \
1194 diff -Naurd mpfr-3.1.2-a/src/mpfr-impl.h mpfr-3.1.2-b/src/mpfr-impl.h
1195 --- mpfr-3.1.2-a/src/mpfr-impl.h 2013-10-09 13:34:21.000000000 +0000
1196 +++ mpfr-3.1.2-b/src/mpfr-impl.h 2014-04-15 22:21:06.220398489 +0000
1202 +#define MPFR_BYTES_PER_MP_LIMB (GMP_NUMB_BITS/CHAR_BIT)
1204 /******************************************************
1205 ******************** Check GMP ***********************
1207 #define MPFR_SET_ALLOC_SIZE(x, n) \
1208 ( ((mp_size_t*) MPFR_MANT(x))[-1] = n)
1209 #define MPFR_MALLOC_SIZE(s) \
1210 - ( sizeof(mpfr_size_limb_t) + BYTES_PER_MP_LIMB * ((size_t) s) )
1211 + ( sizeof(mpfr_size_limb_t) + MPFR_BYTES_PER_MP_LIMB * ((size_t) s) )
1212 #define MPFR_SET_MANT_PTR(x,p) \
1213 (MPFR_MANT(x) = (mp_limb_t*) ((mpfr_size_limb_t*) p + 1))
1214 #define MPFR_GET_REAL_PTR(x) \
1218 #define MPFR_TMP_LIMBS_ALLOC(N) \
1219 - ((mp_limb_t *) MPFR_TMP_ALLOC ((size_t) (N) * BYTES_PER_MP_LIMB))
1220 + ((mp_limb_t *) MPFR_TMP_ALLOC ((size_t) (N) * MPFR_BYTES_PER_MP_LIMB))
1222 /* temporary allocate 1 limb at xp, and initialize mpfr variable x */
1223 /* The temporary var doesn't have any size field, but it doesn't matter
1224 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
1225 --- mpfr-3.1.2-a/src/mpfr.h 2014-04-15 22:20:20.755171478 +0000
1226 +++ mpfr-3.1.2-b/src/mpfr.h 2014-04-15 22:21:45.225450147 +0000
1228 #define MPFR_VERSION_MAJOR 3
1229 #define MPFR_VERSION_MINOR 1
1230 #define MPFR_VERSION_PATCHLEVEL 2
1231 -#define MPFR_VERSION_STRING "3.1.2-p7"
1232 +#define MPFR_VERSION_STRING "3.1.2-p8"
1234 /* Macros dealing with MPFR VERSION */
1235 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1236 diff -Naurd mpfr-3.1.2-a/src/mul.c mpfr-3.1.2-b/src/mul.c
1237 --- mpfr-3.1.2-a/src/mul.c 2013-03-13 15:37:37.000000000 +0000
1238 +++ mpfr-3.1.2-b/src/mul.c 2014-04-15 22:21:06.224398597 +0000
1240 MPFR_ASSERTD(tn <= k);
1242 /* Check for no size_t overflow*/
1243 - MPFR_ASSERTD((size_t) k <= ((size_t) -1) / BYTES_PER_MP_LIMB);
1244 + MPFR_ASSERTD((size_t) k <= ((size_t) -1) / MPFR_BYTES_PER_MP_LIMB);
1245 MPFR_TMP_MARK(marker);
1246 tmp = MPFR_TMP_LIMBS_ALLOC (k);
1249 MPFR_ASSERTD (tn <= k); /* tn <= k, thus no int overflow */
1251 /* Check for no size_t overflow*/
1252 - MPFR_ASSERTD ((size_t) k <= ((size_t) -1) / BYTES_PER_MP_LIMB);
1253 + MPFR_ASSERTD ((size_t) k <= ((size_t) -1) / MPFR_BYTES_PER_MP_LIMB);
1254 MPFR_TMP_MARK (marker);
1255 tmp = MPFR_TMP_LIMBS_ALLOC (k);
1257 diff -Naurd mpfr-3.1.2-a/src/stack_interface.c mpfr-3.1.2-b/src/stack_interface.c
1258 --- mpfr-3.1.2-a/src/stack_interface.c 2013-03-13 15:37:32.000000000 +0000
1259 +++ mpfr-3.1.2-b/src/stack_interface.c 2014-04-15 22:21:06.220398489 +0000
1262 mpfr_custom_get_size (mpfr_prec_t prec)
1264 - return MPFR_PREC2LIMBS (prec) * BYTES_PER_MP_LIMB;
1265 + return MPFR_PREC2LIMBS (prec) * MPFR_BYTES_PER_MP_LIMB;
1268 #undef mpfr_custom_init
1269 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
1270 --- mpfr-3.1.2-a/src/version.c 2014-04-15 22:20:20.755171478 +0000
1271 +++ mpfr-3.1.2-b/src/version.c 2014-04-15 22:21:45.225450147 +0000
1274 mpfr_get_version (void)
1276 - return "3.1.2-p7";
1277 + return "3.1.2-p8";
1279 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
1280 --- mpfr-3.1.2-a/PATCHES 2014-06-30 15:15:25.533266905 +0000
1281 +++ mpfr-3.1.2-b/PATCHES 2014-06-30 15:15:25.617269178 +0000
1284 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
1285 --- mpfr-3.1.2-a/VERSION 2014-06-30 15:15:25.529266797 +0000
1286 +++ mpfr-3.1.2-b/VERSION 2014-06-30 15:15:25.617269178 +0000
1290 diff -Naurd mpfr-3.1.2-a/src/div.c mpfr-3.1.2-b/src/div.c
1291 --- mpfr-3.1.2-a/src/div.c 2013-03-13 15:37:33.000000000 +0000
1292 +++ mpfr-3.1.2-b/src/div.c 2014-06-30 15:15:25.585268312 +0000
1298 + if (MPFR_LIKELY (qexp < MPFR_EXP_MAX))
1300 + /* else qexp is now incorrect, but one will still get an overflow */
1301 q0p[q0size - 1] = MPFR_LIMB_HIGHBIT;
1305 inex = 1; /* always here */
1306 if (mpn_add_1 (q0p, q0p, q0size, MPFR_LIMB_ONE << sh))
1309 + if (MPFR_LIKELY (qexp < MPFR_EXP_MAX))
1311 + /* else qexp is now incorrect, but one will still get an overflow */
1312 q0p[q0size - 1] = MPFR_LIMB_HIGHBIT;
1315 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
1316 --- mpfr-3.1.2-a/src/mpfr.h 2014-06-30 15:15:25.533266905 +0000
1317 +++ mpfr-3.1.2-b/src/mpfr.h 2014-06-30 15:15:25.613269070 +0000
1319 #define MPFR_VERSION_MAJOR 3
1320 #define MPFR_VERSION_MINOR 1
1321 #define MPFR_VERSION_PATCHLEVEL 2
1322 -#define MPFR_VERSION_STRING "3.1.2-p8"
1323 +#define MPFR_VERSION_STRING "3.1.2-p9"
1325 /* Macros dealing with MPFR VERSION */
1326 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1327 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
1328 --- mpfr-3.1.2-a/src/version.c 2014-06-30 15:15:25.533266905 +0000
1329 +++ mpfr-3.1.2-b/src/version.c 2014-06-30 15:15:25.613269070 +0000
1332 mpfr_get_version (void)
1334 - return "3.1.2-p8";
1335 + return "3.1.2-p9";
1337 diff -Naurd mpfr-3.1.2-a/tests/tdiv.c mpfr-3.1.2-b/tests/tdiv.c
1338 --- mpfr-3.1.2-a/tests/tdiv.c 2013-03-13 15:37:44.000000000 +0000
1339 +++ mpfr-3.1.2-b/tests/tdiv.c 2014-06-30 15:15:25.585268312 +0000
1340 @@ -1104,6 +1104,96 @@
1341 #define RAND_FUNCTION(x) mpfr_random2(x, MPFR_LIMB_SIZE (x), randlimb () % 100, RANDS)
1342 #include "tgeneric.c"
1345 +test_extreme (void)
1348 + mpfr_exp_t emin, emax;
1349 + mpfr_prec_t p[4] = { 8, 32, 64, 256 };
1350 + int xi, yi, zi, j, r;
1351 + unsigned int flags, ex_flags;
1353 + emin = mpfr_get_emin ();
1354 + emax = mpfr_get_emax ();
1356 + mpfr_set_emin (MPFR_EMIN_MIN);
1357 + mpfr_set_emax (MPFR_EMAX_MAX);
1359 + for (xi = 0; xi < 4; xi++)
1361 + mpfr_init2 (x, p[xi]);
1362 + mpfr_setmax (x, MPFR_EMAX_MAX);
1363 + MPFR_ASSERTN (mpfr_check (x));
1364 + for (yi = 0; yi < 4; yi++)
1366 + mpfr_init2 (y, p[yi]);
1367 + mpfr_setmin (y, MPFR_EMIN_MIN);
1368 + for (j = 0; j < 2; j++)
1370 + MPFR_ASSERTN (mpfr_check (y));
1371 + for (zi = 0; zi < 4; zi++)
1373 + mpfr_init2 (z, p[zi]);
1376 + mpfr_clear_flags ();
1377 + mpfr_div (z, x, y, (mpfr_rnd_t) r);
1378 + flags = __gmpfr_flags;
1379 + MPFR_ASSERTN (mpfr_check (z));
1380 + ex_flags = MPFR_FLAGS_OVERFLOW | MPFR_FLAGS_INEXACT;
1381 + if (flags != ex_flags)
1383 + printf ("Bad flags in test_extreme on z = a/b"
1385 + mpfr_print_rnd_mode ((mpfr_rnd_t) r));
1390 + printf ("Expected flags:");
1391 + flags_out (ex_flags);
1392 + printf ("Got flags: ");
1393 + flags_out (flags);
1398 + mpfr_clear_flags ();
1399 + mpfr_div (z, y, x, (mpfr_rnd_t) r);
1400 + flags = __gmpfr_flags;
1401 + MPFR_ASSERTN (mpfr_check (z));
1402 + ex_flags = MPFR_FLAGS_UNDERFLOW | MPFR_FLAGS_INEXACT;
1403 + if (flags != ex_flags)
1405 + printf ("Bad flags in test_extreme on z = a/b"
1407 + mpfr_print_rnd_mode ((mpfr_rnd_t) r));
1412 + printf ("Expected flags:");
1413 + flags_out (ex_flags);
1414 + printf ("Got flags: ");
1415 + flags_out (flags);
1423 + mpfr_nextabove (y);
1435 main (int argc, char *argv[])
1437 @@ -1130,6 +1220,7 @@
1440 test_generic (2, 800, 50);
1445 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
1446 --- mpfr-3.1.2-a/PATCHES 2014-06-30 15:17:53.337268149 +0000
1447 +++ mpfr-3.1.2-b/PATCHES 2014-06-30 15:17:53.417270314 +0000
1450 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
1451 --- mpfr-3.1.2-a/VERSION 2014-06-30 15:17:53.337268149 +0000
1452 +++ mpfr-3.1.2-b/VERSION 2014-06-30 15:17:53.413270206 +0000
1456 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
1457 --- mpfr-3.1.2-a/src/mpfr.h 2014-06-30 15:17:53.337268149 +0000
1458 +++ mpfr-3.1.2-b/src/mpfr.h 2014-06-30 15:17:53.413270206 +0000
1460 #define MPFR_VERSION_MAJOR 3
1461 #define MPFR_VERSION_MINOR 1
1462 #define MPFR_VERSION_PATCHLEVEL 2
1463 -#define MPFR_VERSION_STRING "3.1.2-p9"
1464 +#define MPFR_VERSION_STRING "3.1.2-p10"
1466 /* Macros dealing with MPFR VERSION */
1467 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1468 diff -Naurd mpfr-3.1.2-a/src/vasprintf.c mpfr-3.1.2-b/src/vasprintf.c
1469 --- mpfr-3.1.2-a/src/vasprintf.c 2013-11-15 00:51:49.267334408 +0000
1470 +++ mpfr-3.1.2-b/src/vasprintf.c 2014-06-30 15:17:53.377269231 +0000
1471 @@ -884,14 +884,18 @@
1472 first digit, we want the exponent for radix two and the decimal
1473 point AFTER the first digit. */
1475 - MPFR_ASSERTN (exp > MPFR_EMIN_MIN /4); /* possible overflow */
1476 + /* An integer overflow is normally not possible since MPFR_EXP_MIN
1477 + is twice as large as MPFR_EMIN_MIN. */
1478 + MPFR_ASSERTN (exp > (MPFR_EXP_MIN + 3) / 4);
1479 exp = (exp - 1) * 4;
1482 /* EXP is the exponent for decimal point BEFORE the first digit, we
1483 want the exponent for decimal point AFTER the first digit. */
1485 - MPFR_ASSERTN (exp > MPFR_EMIN_MIN); /* possible overflow */
1486 + /* An integer overflow is normally not possible since MPFR_EXP_MIN
1487 + is twice as large as MPFR_EMIN_MIN. */
1488 + MPFR_ASSERTN (exp > MPFR_EXP_MIN);
1492 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
1493 --- mpfr-3.1.2-a/src/version.c 2014-06-30 15:17:53.337268149 +0000
1494 +++ mpfr-3.1.2-b/src/version.c 2014-06-30 15:17:53.413270206 +0000
1497 mpfr_get_version (void)
1499 - return "3.1.2-p9";
1500 + return "3.1.2-p10";
1502 diff -Naurd mpfr-3.1.2-a/tests/tsprintf.c mpfr-3.1.2-b/tests/tsprintf.c
1503 --- mpfr-3.1.2-a/tests/tsprintf.c 2013-11-15 00:51:49.267334408 +0000
1504 +++ mpfr-3.1.2-b/tests/tsprintf.c 2014-06-30 15:17:53.377269231 +0000
1505 @@ -1184,6 +1184,69 @@
1506 check_emax_aux (MPFR_EMAX_MAX);
1510 +check_emin_aux (mpfr_exp_t e)
1513 + char *s1, s2[256];
1518 + MPFR_ASSERTN (e >= LONG_MIN);
1519 + emin = mpfr_get_emin ();
1522 + mpfr_init2 (x, 16);
1525 + mpfr_setmin (x, e);
1526 + mpz_set_si (ee, e);
1527 + mpz_sub_ui (ee, ee, 1);
1529 + i = mpfr_asprintf (&s1, "%Ra", x);
1530 + MPFR_ASSERTN (i > 0);
1532 + gmp_snprintf (s2, 256, "0x1p%Zd", ee);
1534 + if (strcmp (s1, s2) != 0)
1536 + printf ("Error in check_emin_aux for emin = %ld\n", (long) e);
1537 + printf ("Expected %s\n", s2);
1538 + printf ("Got %s\n", s1);
1542 + mpfr_free_str (s1);
1544 + i = mpfr_asprintf (&s1, "%Rb", x);
1545 + MPFR_ASSERTN (i > 0);
1547 + gmp_snprintf (s2, 256, "1p%Zd", ee);
1549 + if (strcmp (s1, s2) != 0)
1551 + printf ("Error in check_emin_aux for emin = %ld\n", (long) e);
1552 + printf ("Expected %s\n", s2);
1553 + printf ("Got %s\n", s1);
1557 + mpfr_free_str (s1);
1567 + check_emin_aux (-15);
1568 + check_emin_aux (mpfr_get_emin ());
1569 + check_emin_aux (MPFR_EMIN_MIN);
1573 main (int argc, char **argv)
1575 @@ -1203,6 +1266,7 @@
1581 #if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE)
1583 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
1584 --- mpfr-3.1.2-a/PATCHES 2014-12-04 01:41:57.131789485 +0000
1585 +++ mpfr-3.1.2-b/PATCHES 2014-12-04 01:41:57.339791833 +0000
1588 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
1589 --- mpfr-3.1.2-a/VERSION 2014-12-04 01:41:57.127789443 +0000
1590 +++ mpfr-3.1.2-b/VERSION 2014-12-04 01:41:57.339791833 +0000
1594 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
1595 --- mpfr-3.1.2-a/src/mpfr.h 2014-12-04 01:41:57.127789443 +0000
1596 +++ mpfr-3.1.2-b/src/mpfr.h 2014-12-04 01:41:57.335791790 +0000
1598 #define MPFR_VERSION_MAJOR 3
1599 #define MPFR_VERSION_MINOR 1
1600 #define MPFR_VERSION_PATCHLEVEL 2
1601 -#define MPFR_VERSION_STRING "3.1.2-p10"
1602 +#define MPFR_VERSION_STRING "3.1.2-p11"
1604 /* Macros dealing with MPFR VERSION */
1605 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
1606 diff -Naurd mpfr-3.1.2-a/src/strtofr.c mpfr-3.1.2-b/src/strtofr.c
1607 --- mpfr-3.1.2-a/src/strtofr.c 2013-03-13 15:37:32.000000000 +0000
1608 +++ mpfr-3.1.2-b/src/strtofr.c 2014-12-04 01:41:57.287791246 +0000
1609 @@ -473,8 +473,10 @@
1610 /* prec bits corresponds to ysize limbs */
1611 ysize_bits = ysize * GMP_NUMB_BITS;
1612 /* and to ysize_bits >= prec > MPFR_PREC (x) bits */
1613 - y = MPFR_TMP_LIMBS_ALLOC (2 * ysize + 1);
1614 - y += ysize; /* y has (ysize+1) allocated limbs */
1615 + /* we need to allocate one more limb to work around bug
1616 + https://gmplib.org/list-archives/gmp-bugs/2013-December/003267.html */
1617 + y = MPFR_TMP_LIMBS_ALLOC (2 * ysize + 2);
1618 + y += ysize; /* y has (ysize+2) allocated limbs */
1620 /* pstr_size is the number of characters we read in pstr->mant
1621 to have at least ysize full limbs.
1622 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
1623 --- mpfr-3.1.2-a/src/version.c 2014-12-04 01:41:57.131789485 +0000
1624 +++ mpfr-3.1.2-b/src/version.c 2014-12-04 01:41:57.339791833 +0000
1627 mpfr_get_version (void)
1629 - return "3.1.2-p10";
1630 + return "3.1.2-p11";