Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/mpfr/files/3.1.2: patch01 patch03 patch02 patch05 patch04
Date: Wed, 26 Mar 2014 05:45:25
Message-Id: 20140326054519.5061A2004F@flycatcher.gentoo.org
1 vapier 14/03/26 05:45:19
2
3 Added: patch01 patch03 patch02 patch05 patch04
4 Log:
5 Version bump.
6
7 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
8
9 Revision Changes Path
10 1.1 dev-libs/mpfr/files/3.1.2/patch01
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/mpfr/files/3.1.2/patch01?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/mpfr/files/3.1.2/patch01?rev=1.1&content-type=text/plain
14
15 Index: patch01
16 ===================================================================
17 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
18 --- mpfr-3.1.2-a/PATCHES 2013-09-26 10:52:52.000000000 +0000
19 +++ mpfr-3.1.2-b/PATCHES 2013-09-26 10:52:52.000000000 +0000
20 @@ -0,0 +1 @@
21 +exp_2
22 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
23 --- mpfr-3.1.2-a/VERSION 2013-03-13 15:37:28.000000000 +0000
24 +++ mpfr-3.1.2-b/VERSION 2013-09-26 10:52:52.000000000 +0000
25 @@ -1 +1 @@
26 -3.1.2
27 +3.1.2-p1
28 diff -Naurd mpfr-3.1.2-a/src/exp_2.c mpfr-3.1.2-b/src/exp_2.c
29 --- mpfr-3.1.2-a/src/exp_2.c 2013-03-13 15:37:28.000000000 +0000
30 +++ mpfr-3.1.2-b/src/exp_2.c 2013-09-26 10:52:52.000000000 +0000
31 @@ -204,7 +204,7 @@
32 for (k = 0; k < K; k++)
33 {
34 mpz_mul (ss, ss, ss);
35 - exps <<= 1;
36 + exps *= 2;
37 exps += mpz_normalize (ss, ss, q);
38 }
39 mpfr_set_z (s, ss, MPFR_RNDN);
40 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
41 --- mpfr-3.1.2-a/src/mpfr.h 2013-03-13 15:37:37.000000000 +0000
42 +++ mpfr-3.1.2-b/src/mpfr.h 2013-09-26 10:52:52.000000000 +0000
43 @@ -27,7 +27,7 @@
44 #define MPFR_VERSION_MAJOR 3
45 #define MPFR_VERSION_MINOR 1
46 #define MPFR_VERSION_PATCHLEVEL 2
47 -#define MPFR_VERSION_STRING "3.1.2"
48 +#define MPFR_VERSION_STRING "3.1.2-p1"
49
50 /* Macros dealing with MPFR VERSION */
51 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
52 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
53 --- mpfr-3.1.2-a/src/version.c 2013-03-13 15:37:34.000000000 +0000
54 +++ mpfr-3.1.2-b/src/version.c 2013-09-26 10:52:52.000000000 +0000
55 @@ -25,5 +25,5 @@
56 const char *
57 mpfr_get_version (void)
58 {
59 - return "3.1.2";
60 + return "3.1.2-p1";
61 }
62
63
64
65 1.1 dev-libs/mpfr/files/3.1.2/patch03
66
67 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/mpfr/files/3.1.2/patch03?rev=1.1&view=markup
68 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/mpfr/files/3.1.2/patch03?rev=1.1&content-type=text/plain
69
70 Index: patch03
71 ===================================================================
72 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
73 --- mpfr-3.1.2-a/PATCHES 2013-10-09 13:34:21.000000000 +0000
74 +++ mpfr-3.1.2-b/PATCHES 2013-10-09 13:34:21.000000000 +0000
75 @@ -0,0 +1 @@
76 +clang-divby0
77 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
78 --- mpfr-3.1.2-a/VERSION 2013-09-26 10:52:52.000000000 +0000
79 +++ mpfr-3.1.2-b/VERSION 2013-10-09 13:34:21.000000000 +0000
80 @@ -1 +1 @@
81 -3.1.2-p2
82 +3.1.2-p3
83 diff -Naurd mpfr-3.1.2-a/src/mpfr-impl.h mpfr-3.1.2-b/src/mpfr-impl.h
84 --- mpfr-3.1.2-a/src/mpfr-impl.h 2013-03-13 15:37:36.000000000 +0000
85 +++ mpfr-3.1.2-b/src/mpfr-impl.h 2013-10-09 13:34:21.000000000 +0000
86 @@ -468,8 +468,16 @@
87 #define MPFR_LIMBS_PER_FLT ((IEEE_FLT_MANT_DIG-1)/GMP_NUMB_BITS+1)
88
89 /* Visual C++ doesn't support +1.0/0.0, -1.0/0.0 and 0.0/0.0
90 - at compile time. */
91 -#if defined(_MSC_VER) && defined(_WIN32) && (_MSC_VER >= 1200)
92 + at compile time.
93 + Clang with -fsanitize=undefined is a bit similar due to a bug:
94 + http://llvm.org/bugs/show_bug.cgi?id=17381
95 + but even without its sanitizer, it may be better to use the
96 + double_zero version until IEEE 754 division by zero is properly
97 + supported:
98 + http://llvm.org/bugs/show_bug.cgi?id=17000
99 +*/
100 +#if (defined(_MSC_VER) && defined(_WIN32) && (_MSC_VER >= 1200)) || \
101 + defined(__clang__)
102 static double double_zero = 0.0;
103 # define DBL_NAN (double_zero/double_zero)
104 # define DBL_POS_INF ((double) 1.0/double_zero)
105 @@ -501,6 +509,8 @@
106 (with Xcode 2.4.1, i.e. the latest one). */
107 #define LVALUE(x) (&(x) == &(x) || &(x) != &(x))
108 #define DOUBLE_ISINF(x) (LVALUE(x) && ((x) > DBL_MAX || (x) < -DBL_MAX))
109 +/* The DOUBLE_ISNAN(x) macro is also valid on long double x
110 + (assuming that the compiler isn't too broken). */
111 #ifdef MPFR_NANISNAN
112 /* Avoid MIPSpro / IRIX64 / gcc -ffast-math (incorrect) optimizations.
113 The + must not be replaced by a ||. With gcc -ffast-math, NaN is
114 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
115 --- mpfr-3.1.2-a/src/mpfr.h 2013-09-26 10:52:52.000000000 +0000
116 +++ mpfr-3.1.2-b/src/mpfr.h 2013-10-09 13:34:21.000000000 +0000
117 @@ -27,7 +27,7 @@
118 #define MPFR_VERSION_MAJOR 3
119 #define MPFR_VERSION_MINOR 1
120 #define MPFR_VERSION_PATCHLEVEL 2
121 -#define MPFR_VERSION_STRING "3.1.2-p2"
122 +#define MPFR_VERSION_STRING "3.1.2-p3"
123
124 /* Macros dealing with MPFR VERSION */
125 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
126 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
127 --- mpfr-3.1.2-a/src/version.c 2013-09-26 10:52:52.000000000 +0000
128 +++ mpfr-3.1.2-b/src/version.c 2013-10-09 13:34:21.000000000 +0000
129 @@ -25,5 +25,5 @@
130 const char *
131 mpfr_get_version (void)
132 {
133 - return "3.1.2-p2";
134 + return "3.1.2-p3";
135 }
136 diff -Naurd mpfr-3.1.2-a/tests/tget_flt.c mpfr-3.1.2-b/tests/tget_flt.c
137 --- mpfr-3.1.2-a/tests/tget_flt.c 2013-03-13 15:37:44.000000000 +0000
138 +++ mpfr-3.1.2-b/tests/tget_flt.c 2013-10-09 13:34:21.000000000 +0000
139 @@ -28,9 +28,17 @@
140 main (void)
141 {
142 mpfr_t x, y;
143 - float f, g, infp;
144 + float f, g;
145 int i;
146 +#if !defined(MPFR_ERRDIVZERO)
147 + float infp;
148 +#endif
149 +
150 + tests_start_mpfr ();
151
152 +#if !defined(MPFR_ERRDIVZERO)
153 + /* The definition of DBL_POS_INF involves a division by 0. This makes
154 + "clang -O2 -fsanitize=undefined -fno-sanitize-recover" fail. */
155 infp = (float) DBL_POS_INF;
156 if (infp * 0.5 != infp)
157 {
158 @@ -38,8 +46,7 @@
159 fprintf (stderr, "(this is probably a compiler bug, please report)\n");
160 exit (1);
161 }
162 -
163 - tests_start_mpfr ();
164 +#endif
165
166 mpfr_init2 (x, 24);
167 mpfr_init2 (y, 24);
168 @@ -353,6 +360,7 @@
169 printf ("expected %.8e, got %.8e\n", g, f);
170 exit (1);
171 }
172 +#if !defined(MPFR_ERRDIVZERO)
173 f = mpfr_get_flt (x, MPFR_RNDN); /* first round to 2^128 (even rule),
174 thus we should get +Inf */
175 g = infp;
176 @@ -376,6 +384,7 @@
177 printf ("expected %.8e, got %.8e\n", g, f);
178 exit (1);
179 }
180 +#endif
181
182 mpfr_clear (x);
183 mpfr_clear (y);
184 diff -Naurd mpfr-3.1.2-a/tests/tset_ld.c mpfr-3.1.2-b/tests/tset_ld.c
185 --- mpfr-3.1.2-a/tests/tset_ld.c 2013-03-13 15:37:44.000000000 +0000
186 +++ mpfr-3.1.2-b/tests/tset_ld.c 2013-10-09 13:34:21.000000000 +0000
187 @@ -47,8 +47,11 @@
188 static int
189 Isnan_ld (long double d)
190 {
191 - double e = (double) d;
192 - if (DOUBLE_ISNAN (e))
193 + /* Do not convert d to double as this can give an overflow, which
194 + may confuse compilers without IEEE 754 support (such as clang
195 + -fsanitize=undefined), or trigger a trap if enabled.
196 + The DOUBLE_ISNAN macro should work fine on long double. */
197 + if (DOUBLE_ISNAN (d))
198 return 1;
199 LONGDOUBLE_NAN_ACTION (d, goto yes);
200 return 0;
201
202
203
204 1.1 dev-libs/mpfr/files/3.1.2/patch02
205
206 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/mpfr/files/3.1.2/patch02?rev=1.1&view=markup
207 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/mpfr/files/3.1.2/patch02?rev=1.1&content-type=text/plain
208
209 Index: patch02
210 ===================================================================
211 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
212 --- mpfr-3.1.2-a/PATCHES 2013-09-26 10:56:55.000000000 +0000
213 +++ mpfr-3.1.2-b/PATCHES 2013-09-26 10:56:55.000000000 +0000
214 @@ -0,0 +1 @@
215 +fits-smallneg
216 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
217 --- mpfr-3.1.2-a/VERSION 2013-09-26 10:52:52.000000000 +0000
218 +++ mpfr-3.1.2-b/VERSION 2013-09-26 10:56:55.000000000 +0000
219 @@ -1 +1 @@
220 -3.1.2-p1
221 +3.1.2-p2
222 diff -Naurd mpfr-3.1.2-a/src/fits_u.h mpfr-3.1.2-b/src/fits_u.h
223 --- mpfr-3.1.2-a/src/fits_u.h 2013-03-13 15:37:35.000000000 +0000
224 +++ mpfr-3.1.2-b/src/fits_u.h 2013-09-26 10:56:55.000000000 +0000
225 @@ -32,17 +32,20 @@
226 int res;
227
228 if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (f)))
229 - /* Zero always fit */
230 - return MPFR_IS_ZERO (f) ? 1 : 0;
231 - else if (MPFR_IS_NEG (f))
232 - /* Negative numbers don't fit */
233 - return 0;
234 - /* now it fits if
235 - (a) f <= MAXIMUM
236 - (b) round(f, prec(slong), rnd) <= MAXIMUM */
237 + return MPFR_IS_ZERO (f) ? 1 : 0; /* Zero always fits */
238
239 e = MPFR_GET_EXP (f);
240
241 + if (MPFR_IS_NEG (f))
242 + return e >= 1 ? 0 /* f <= -1 does not fit */
243 + : rnd != MPFR_RNDN ? MPFR_IS_LIKE_RNDU (rnd, -1) /* directed mode */
244 + : e < 0 ? 1 /* f > -1/2 fits in MPFR_RNDN */
245 + : mpfr_powerof2_raw(f); /* -1/2 fits, -1 < f < -1/2 don't */
246 +
247 + /* Now it fits if
248 + (a) f <= MAXIMUM
249 + (b) round(f, prec(slong), rnd) <= MAXIMUM */
250 +
251 /* first compute prec(MAXIMUM); fits in an int */
252 for (s = MAXIMUM, prec = 0; s != 0; s /= 2, prec ++);
253
254 diff -Naurd mpfr-3.1.2-a/src/fits_uintmax.c mpfr-3.1.2-b/src/fits_uintmax.c
255 --- mpfr-3.1.2-a/src/fits_uintmax.c 2013-03-13 15:37:33.000000000 +0000
256 +++ mpfr-3.1.2-b/src/fits_uintmax.c 2013-09-26 10:56:55.000000000 +0000
257 @@ -27,51 +27,19 @@
258 #include "mpfr-intmax.h"
259 #include "mpfr-impl.h"
260
261 -#ifdef _MPFR_H_HAVE_INTMAX_T
262 -
263 -/* We can't use fits_u.h <= mpfr_cmp_ui */
264 -int
265 -mpfr_fits_uintmax_p (mpfr_srcptr f, mpfr_rnd_t rnd)
266 -{
267 - mpfr_exp_t e;
268 - int prec;
269 - uintmax_t s;
270 - mpfr_t x;
271 - int res;
272 -
273 - if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (f)))
274 - /* Zero always fit */
275 - return MPFR_IS_ZERO (f) ? 1 : 0;
276 - else if (MPFR_IS_NEG (f))
277 - /* Negative numbers don't fit */
278 - return 0;
279 - /* now it fits if
280 - (a) f <= MAXIMUM
281 - (b) round(f, prec(slong), rnd) <= MAXIMUM */
282 -
283 - e = MPFR_GET_EXP (f);
284 -
285 - /* first compute prec(MAXIMUM); fits in an int */
286 - for (s = MPFR_UINTMAX_MAX, prec = 0; s != 0; s /= 2, prec ++);
287 -
288 - /* MAXIMUM needs prec bits, i.e. MAXIMUM = 2^prec - 1 */
289 -
290 - /* if e <= prec - 1, then f < 2^(prec-1) < MAXIMUM */
291 - if (e <= prec - 1)
292 - return 1;
293 +/* Note: though mpfr-impl.h is included in fits_u.h, we also include it
294 + above so that it gets included even when _MPFR_H_HAVE_INTMAX_T is not
295 + defined; this is necessary to avoid an empty translation unit, which
296 + is forbidden by ISO C. Without this, a failing test can be reproduced
297 + by creating an invalid stdint.h somewhere in the default include path
298 + and by compiling MPFR with "gcc -ansi -pedantic-errors". */
299
300 - /* if e >= prec + 1, then f >= 2^prec > MAXIMUM */
301 - if (e >= prec + 1)
302 - return 0;
303 +#ifdef _MPFR_H_HAVE_INTMAX_T
304
305 - MPFR_ASSERTD (e == prec);
306 +#define FUNCTION mpfr_fits_uintmax_p
307 +#define MAXIMUM MPFR_UINTMAX_MAX
308 +#define TYPE uintmax_t
309
310 - /* hard case: first round to prec bits, then check */
311 - mpfr_init2 (x, prec);
312 - mpfr_set (x, f, rnd);
313 - res = MPFR_GET_EXP (x) == e;
314 - mpfr_clear (x);
315 - return res;
316 -}
317 +#include "fits_u.h"
318
319 #endif
320 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
321 --- mpfr-3.1.2-a/src/mpfr.h 2013-09-26 10:52:52.000000000 +0000
322 +++ mpfr-3.1.2-b/src/mpfr.h 2013-09-26 10:56:55.000000000 +0000
323 @@ -27,7 +27,7 @@
324 #define MPFR_VERSION_MAJOR 3
325 #define MPFR_VERSION_MINOR 1
326 #define MPFR_VERSION_PATCHLEVEL 2
327 -#define MPFR_VERSION_STRING "3.1.2-p1"
328 +#define MPFR_VERSION_STRING "3.1.2-p2"
329
330 /* Macros dealing with MPFR VERSION */
331 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
332 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
333 --- mpfr-3.1.2-a/src/version.c 2013-09-26 10:52:52.000000000 +0000
334 +++ mpfr-3.1.2-b/src/version.c 2013-09-26 10:56:55.000000000 +0000
335 @@ -25,5 +25,5 @@
336 const char *
337 mpfr_get_version (void)
338 {
339 - return "3.1.2-p1";
340 + return "3.1.2-p2";
341 }
342 diff -Naurd mpfr-3.1.2-a/tests/tfits.c mpfr-3.1.2-b/tests/tfits.c
343 --- mpfr-3.1.2-a/tests/tfits.c 2013-03-13 15:37:45.000000000 +0000
344 +++ mpfr-3.1.2-b/tests/tfits.c 2013-09-26 10:56:55.000000000 +0000
345 @@ -33,155 +33,176 @@
346 #include "mpfr-intmax.h"
347 #include "mpfr-test.h"
348
349 -#define ERROR1 { printf("Initial error for x="); mpfr_dump(x); exit(1); }
350 -#define ERROR2 { printf("Error for x="); mpfr_dump(x); exit(1); }
351 +#define ERROR1(N) \
352 + do \
353 + { \
354 + printf("Error %d for rnd = %s and x = ", N, \
355 + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); \
356 + mpfr_dump(x); \
357 + exit(1); \
358 + } \
359 + while (0)
360
361 static void check_intmax (void);
362
363 int
364 main (void)
365 {
366 - mpfr_t x;
367 + mpfr_t x, y;
368 + int i, r;
369
370 tests_start_mpfr ();
371
372 mpfr_init2 (x, 256);
373 + mpfr_init2 (y, 8);
374
375 - /* Check NAN */
376 - mpfr_set_nan (x);
377 - if (mpfr_fits_ulong_p (x, MPFR_RNDN))
378 - ERROR1;
379 - if (mpfr_fits_slong_p (x, MPFR_RNDN))
380 - ERROR1;
381 - if (mpfr_fits_uint_p (x, MPFR_RNDN))
382 - ERROR1;
383 - if (mpfr_fits_sint_p (x, MPFR_RNDN))
384 - ERROR1;
385 - if (mpfr_fits_ushort_p (x, MPFR_RNDN))
386 - ERROR1;
387 - if (mpfr_fits_sshort_p (x, MPFR_RNDN))
388 - ERROR1;
389 + RND_LOOP (r)
390 + {
391
392 - /* Check INF */
393 - mpfr_set_inf (x, 1);
394 - if (mpfr_fits_ulong_p (x, MPFR_RNDN))
395 - ERROR1;
396 - if (mpfr_fits_slong_p (x, MPFR_RNDN))
397 - ERROR1;
398 - if (mpfr_fits_uint_p (x, MPFR_RNDN))
399 - ERROR1;
400 - if (mpfr_fits_sint_p (x, MPFR_RNDN))
401 - ERROR1;
402 - if (mpfr_fits_ushort_p (x, MPFR_RNDN))
403 - ERROR1;
404 - if (mpfr_fits_sshort_p (x, MPFR_RNDN))
405 - ERROR1;
406 + /* Check NAN */
407 + mpfr_set_nan (x);
408 + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
409 + ERROR1 (1);
410 + if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
411 + ERROR1 (2);
412 + if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
413 + ERROR1 (3);
414 + if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
415 + ERROR1 (4);
416 + if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
417 + ERROR1 (5);
418 + if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
419 + ERROR1 (6);
420
421 - /* Check Zero */
422 - MPFR_SET_ZERO (x);
423 - if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
424 - ERROR2;
425 - if (!mpfr_fits_slong_p (x, MPFR_RNDN))
426 - ERROR2;
427 - if (!mpfr_fits_uint_p (x, MPFR_RNDN))
428 - ERROR2;
429 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
430 - ERROR2;
431 - if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
432 - ERROR2;
433 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
434 - ERROR2;
435 + /* Check INF */
436 + mpfr_set_inf (x, 1);
437 + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
438 + ERROR1 (7);
439 + if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
440 + ERROR1 (8);
441 + if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
442 + ERROR1 (9);
443 + if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
444 + ERROR1 (10);
445 + if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
446 + ERROR1 (11);
447 + if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
448 + ERROR1 (12);
449
450 - /* Check small op */
451 - mpfr_set_str1 (x, "1@-1");
452 - if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
453 - ERROR2;
454 - if (!mpfr_fits_slong_p (x, MPFR_RNDN))
455 - ERROR2;
456 - if (!mpfr_fits_uint_p (x, MPFR_RNDN))
457 - ERROR2;
458 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
459 - ERROR2;
460 - if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
461 - ERROR2;
462 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
463 - ERROR2;
464 + /* Check Zero */
465 + MPFR_SET_ZERO (x);
466 + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
467 + ERROR1 (13);
468 + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
469 + ERROR1 (14);
470 + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
471 + ERROR1 (15);
472 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
473 + ERROR1 (16);
474 + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
475 + ERROR1 (17);
476 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
477 + ERROR1 (18);
478
479 - /* Check 17 */
480 - mpfr_set_ui (x, 17, MPFR_RNDN);
481 - if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
482 - ERROR2;
483 - if (!mpfr_fits_slong_p (x, MPFR_RNDN))
484 - ERROR2;
485 - if (!mpfr_fits_uint_p (x, MPFR_RNDN))
486 - ERROR2;
487 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
488 - ERROR2;
489 - if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
490 - ERROR2;
491 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
492 - ERROR2;
493 + /* Check small positive op */
494 + mpfr_set_str1 (x, "1@-1");
495 + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
496 + ERROR1 (19);
497 + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
498 + ERROR1 (20);
499 + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
500 + ERROR1 (21);
501 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
502 + ERROR1 (22);
503 + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
504 + ERROR1 (23);
505 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
506 + ERROR1 (24);
507
508 - /* Check all other values */
509 - mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
510 - mpfr_mul_2exp (x, x, 1, MPFR_RNDN);
511 - if (mpfr_fits_ulong_p (x, MPFR_RNDN))
512 - ERROR1;
513 - if (mpfr_fits_slong_p (x, MPFR_RNDN))
514 - ERROR1;
515 - mpfr_mul_2exp (x, x, 40, MPFR_RNDN);
516 - if (mpfr_fits_ulong_p (x, MPFR_RNDN))
517 - ERROR1;
518 - if (mpfr_fits_uint_p (x, MPFR_RNDN))
519 - ERROR1;
520 - if (mpfr_fits_sint_p (x, MPFR_RNDN))
521 - ERROR1;
522 - if (mpfr_fits_ushort_p (x, MPFR_RNDN))
523 - ERROR1;
524 - if (mpfr_fits_sshort_p (x, MPFR_RNDN))
525 - ERROR1;
526 + /* Check 17 */
527 + mpfr_set_ui (x, 17, MPFR_RNDN);
528 + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
529 + ERROR1 (25);
530 + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
531 + ERROR1 (26);
532 + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
533 + ERROR1 (27);
534 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
535 + ERROR1 (28);
536 + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
537 + ERROR1 (29);
538 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
539 + ERROR1 (30);
540
541 - mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
542 - if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
543 - ERROR2;
544 - mpfr_set_ui (x, LONG_MAX, MPFR_RNDN);
545 - if (!mpfr_fits_slong_p (x, MPFR_RNDN))
546 - ERROR2;
547 - mpfr_set_ui (x, UINT_MAX, MPFR_RNDN);
548 - if (!mpfr_fits_uint_p (x, MPFR_RNDN))
549 - ERROR2;
550 - mpfr_set_ui (x, INT_MAX, MPFR_RNDN);
551 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
552 - ERROR2;
553 - mpfr_set_ui (x, USHRT_MAX, MPFR_RNDN);
554 - if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
555 - ERROR2;
556 - mpfr_set_ui (x, SHRT_MAX, MPFR_RNDN);
557 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
558 - ERROR2;
559 + /* Check all other values */
560 + mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
561 + mpfr_mul_2exp (x, x, 1, MPFR_RNDN);
562 + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
563 + ERROR1 (31);
564 + if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
565 + ERROR1 (32);
566 + mpfr_mul_2exp (x, x, 40, MPFR_RNDN);
567 + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
568 + ERROR1 (33);
569 + if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
570 + ERROR1 (34);
571 + if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
572 + ERROR1 (35);
573 + if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
574 + ERROR1 (36);
575 + if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
576 + ERROR1 (37);
577
578 - mpfr_set_si (x, 1, MPFR_RNDN);
579 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
580 - ERROR2;
581 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
582 - ERROR2;
583 + mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
584 + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
585 + ERROR1 (38);
586 + mpfr_set_ui (x, LONG_MAX, MPFR_RNDN);
587 + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
588 + ERROR1 (39);
589 + mpfr_set_ui (x, UINT_MAX, MPFR_RNDN);
590 + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
591 + ERROR1 (40);
592 + mpfr_set_ui (x, INT_MAX, MPFR_RNDN);
593 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
594 + ERROR1 (41);
595 + mpfr_set_ui (x, USHRT_MAX, MPFR_RNDN);
596 + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
597 + ERROR1 (42);
598 + mpfr_set_ui (x, SHRT_MAX, MPFR_RNDN);
599 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
600 + ERROR1 (43);
601
602 - /* Check negative value */
603 - mpfr_set_si (x, -1, MPFR_RNDN);
604 - if (!mpfr_fits_sint_p (x, MPFR_RNDN))
605 - ERROR2;
606 - if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
607 - ERROR2;
608 - if (!mpfr_fits_slong_p (x, MPFR_RNDN))
609 - ERROR2;
610 - if (mpfr_fits_uint_p (x, MPFR_RNDN))
611 - ERROR1;
612 - if (mpfr_fits_ushort_p (x, MPFR_RNDN))
613 - ERROR1;
614 - if (mpfr_fits_ulong_p (x, MPFR_RNDN))
615 - ERROR1;
616 + mpfr_set_si (x, 1, MPFR_RNDN);
617 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
618 + ERROR1 (44);
619 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
620 + ERROR1 (45);
621 +
622 + /* Check negative op */
623 + for (i = 1; i <= 4; i++)
624 + {
625 + int inv;
626 +
627 + mpfr_set_si_2exp (x, -i, -2, MPFR_RNDN);
628 + mpfr_rint (y, x, (mpfr_rnd_t) r);
629 + inv = MPFR_NOTZERO (y);
630 + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r) ^ inv)
631 + ERROR1 (46);
632 + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
633 + ERROR1 (47);
634 + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r) ^ inv)
635 + ERROR1 (48);
636 + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
637 + ERROR1 (49);
638 + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r) ^ inv)
639 + ERROR1 (50);
640 + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
641 + ERROR1 (51);
642 + }
643 + }
644
645 mpfr_clear (x);
646 + mpfr_clear (y);
647
648 check_intmax ();
649
650 @@ -189,85 +210,98 @@
651 return 0;
652 }
653
654 -static void check_intmax (void)
655 +static void
656 +check_intmax (void)
657 {
658 #ifdef _MPFR_H_HAVE_INTMAX_T
659 - mpfr_t x;
660 + mpfr_t x, y;
661 + int i, r;
662
663 - mpfr_init2 (x, sizeof (uintmax_t)*CHAR_BIT);
664 + mpfr_init2 (x, sizeof (uintmax_t) * CHAR_BIT);
665 + mpfr_init2 (y, 8);
666
667 - /* Check NAN */
668 - mpfr_set_nan (x);
669 - if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
670 - ERROR1;
671 - if (mpfr_fits_intmax_p (x, MPFR_RNDN))
672 - ERROR1;
673 + RND_LOOP (r)
674 + {
675 + /* Check NAN */
676 + mpfr_set_nan (x);
677 + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
678 + ERROR1 (52);
679 + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
680 + ERROR1 (53);
681
682 - /* Check INF */
683 - mpfr_set_inf (x, 1);
684 - if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
685 - ERROR1;
686 - if (mpfr_fits_intmax_p (x, MPFR_RNDN))
687 - ERROR1;
688 + /* Check INF */
689 + mpfr_set_inf (x, 1);
690 + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
691 + ERROR1 (54);
692 + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
693 + ERROR1 (55);
694
695 - /* Check Zero */
696 - MPFR_SET_ZERO (x);
697 - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
698 - ERROR2;
699 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
700 - ERROR2;
701 + /* Check Zero */
702 + MPFR_SET_ZERO (x);
703 + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
704 + ERROR1 (56);
705 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
706 + ERROR1 (57);
707
708 - /* Check small op */
709 - mpfr_set_str1 (x, "1@-1");
710 - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
711 - ERROR2;
712 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
713 - ERROR2;
714 + /* Check positive small op */
715 + mpfr_set_str1 (x, "1@-1");
716 + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
717 + ERROR1 (58);
718 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
719 + ERROR1 (59);
720
721 - /* Check 17 */
722 - mpfr_set_ui (x, 17, MPFR_RNDN);
723 - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
724 - ERROR2;
725 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
726 - ERROR2;
727 + /* Check 17 */
728 + mpfr_set_ui (x, 17, MPFR_RNDN);
729 + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
730 + ERROR1 (60);
731 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
732 + ERROR1 (61);
733
734 - /* Check hugest */
735 - mpfr_set_ui_2exp (x, 42, sizeof (uintmax_t) * 32, MPFR_RNDN);
736 - if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
737 - ERROR1;
738 - if (mpfr_fits_intmax_p (x, MPFR_RNDN))
739 - ERROR1;
740 + /* Check hugest */
741 + mpfr_set_ui_2exp (x, 42, sizeof (uintmax_t) * 32, MPFR_RNDN);
742 + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
743 + ERROR1 (62);
744 + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
745 + ERROR1 (63);
746
747 - /* Check all other values */
748 - mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
749 - mpfr_add_ui (x, x, 1, MPFR_RNDN);
750 - if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
751 - ERROR1;
752 - mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
753 - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
754 - ERROR2;
755 - mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
756 - mpfr_add_ui (x, x, 1, MPFR_RNDN);
757 - if (mpfr_fits_intmax_p (x, MPFR_RNDN))
758 - ERROR1;
759 - mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
760 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
761 - ERROR2;
762 - mpfr_set_sj (x, MPFR_INTMAX_MIN, MPFR_RNDN);
763 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
764 - ERROR2;
765 - mpfr_sub_ui (x, x, 1, MPFR_RNDN);
766 - if (mpfr_fits_intmax_p (x, MPFR_RNDN))
767 - ERROR1;
768 + /* Check all other values */
769 + mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
770 + mpfr_add_ui (x, x, 1, MPFR_RNDN);
771 + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
772 + ERROR1 (64);
773 + mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
774 + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
775 + ERROR1 (65);
776 + mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
777 + mpfr_add_ui (x, x, 1, MPFR_RNDN);
778 + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
779 + ERROR1 (66);
780 + mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
781 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
782 + ERROR1 (67);
783 + mpfr_set_sj (x, MPFR_INTMAX_MIN, MPFR_RNDN);
784 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
785 + ERROR1 (68);
786 + mpfr_sub_ui (x, x, 1, MPFR_RNDN);
787 + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
788 + ERROR1 (69);
789
790 - /* Check negative value */
791 - mpfr_set_si (x, -1, MPFR_RNDN);
792 - if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
793 - ERROR2;
794 - if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
795 - ERROR1;
796 + /* Check negative op */
797 + for (i = 1; i <= 4; i++)
798 + {
799 + int inv;
800 +
801 + mpfr_set_si_2exp (x, -i, -2, MPFR_RNDN);
802 + mpfr_rint (y, x, (mpfr_rnd_t) r);
803 + inv = MPFR_NOTZERO (y);
804 + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r) ^ inv)
805 + ERROR1 (70);
806 + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
807 + ERROR1 (71);
808 + }
809 + }
810
811 mpfr_clear (x);
812 + mpfr_clear (y);
813 #endif
814 }
815 -
816
817
818
819 1.1 dev-libs/mpfr/files/3.1.2/patch05
820
821 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/mpfr/files/3.1.2/patch05?rev=1.1&view=markup
822 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/mpfr/files/3.1.2/patch05?rev=1.1&content-type=text/plain
823
824 Index: patch05
825 ===================================================================
826 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
827 --- mpfr-3.1.2-a/PATCHES 2013-12-01 11:07:49.575329762 +0000
828 +++ mpfr-3.1.2-b/PATCHES 2013-12-01 11:07:49.751331625 +0000
829 @@ -0,0 +1 @@
830 +custom_init_set
831 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
832 --- mpfr-3.1.2-a/VERSION 2013-12-01 11:07:49.571329714 +0000
833 +++ mpfr-3.1.2-b/VERSION 2013-12-01 11:07:49.747331585 +0000
834 @@ -1 +1 @@
835 -3.1.2-p4
836 +3.1.2-p5
837 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
838 --- mpfr-3.1.2-a/src/mpfr.h 2013-12-01 11:07:49.571329714 +0000
839 +++ mpfr-3.1.2-b/src/mpfr.h 2013-12-01 11:07:49.747331585 +0000
840 @@ -27,7 +27,7 @@
841 #define MPFR_VERSION_MAJOR 3
842 #define MPFR_VERSION_MINOR 1
843 #define MPFR_VERSION_PATCHLEVEL 2
844 -#define MPFR_VERSION_STRING "3.1.2-p4"
845 +#define MPFR_VERSION_STRING "3.1.2-p5"
846
847 /* Macros dealing with MPFR VERSION */
848 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
849 @@ -861,7 +861,7 @@
850 _t = (mpfr_kind_t) _k; \
851 _s = 1; \
852 } else { \
853 - _t = (mpfr_kind_t) -k; \
854 + _t = (mpfr_kind_t) - _k; \
855 _s = -1; \
856 } \
857 _e = _t == MPFR_REGULAR_KIND ? (e) : \
858 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
859 --- mpfr-3.1.2-a/src/version.c 2013-12-01 11:07:49.575329762 +0000
860 +++ mpfr-3.1.2-b/src/version.c 2013-12-01 11:07:49.747331585 +0000
861 @@ -25,5 +25,5 @@
862 const char *
863 mpfr_get_version (void)
864 {
865 - return "3.1.2-p4";
866 + return "3.1.2-p5";
867 }
868
869
870
871 1.1 dev-libs/mpfr/files/3.1.2/patch04
872
873 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/mpfr/files/3.1.2/patch04?rev=1.1&view=markup
874 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/mpfr/files/3.1.2/patch04?rev=1.1&content-type=text/plain
875
876 Index: patch04
877 ===================================================================
878 diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
879 --- mpfr-3.1.2-a/PATCHES 2013-11-15 00:51:49.211333830 +0000
880 +++ mpfr-3.1.2-b/PATCHES 2013-11-15 00:51:49.323334999 +0000
881 @@ -0,0 +1 @@
882 +printf-alt0
883 diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
884 --- mpfr-3.1.2-a/VERSION 2013-11-15 00:51:49.211333830 +0000
885 +++ mpfr-3.1.2-b/VERSION 2013-11-15 00:51:49.323334999 +0000
886 @@ -1 +1 @@
887 -3.1.2-p3
888 +3.1.2-p4
889 diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
890 --- mpfr-3.1.2-a/src/mpfr.h 2013-11-15 00:51:49.211333830 +0000
891 +++ mpfr-3.1.2-b/src/mpfr.h 2013-11-15 00:51:49.323334999 +0000
892 @@ -27,7 +27,7 @@
893 #define MPFR_VERSION_MAJOR 3
894 #define MPFR_VERSION_MINOR 1
895 #define MPFR_VERSION_PATCHLEVEL 2
896 -#define MPFR_VERSION_STRING "3.1.2-p3"
897 +#define MPFR_VERSION_STRING "3.1.2-p4"
898
899 /* Macros dealing with MPFR VERSION */
900 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
901 diff -Naurd mpfr-3.1.2-a/src/vasprintf.c mpfr-3.1.2-b/src/vasprintf.c
902 --- mpfr-3.1.2-a/src/vasprintf.c 2013-03-13 15:37:37.000000000 +0000
903 +++ mpfr-3.1.2-b/src/vasprintf.c 2013-11-15 00:51:49.267334408 +0000
904 @@ -1040,7 +1040,7 @@
905 }
906
907 /* Determine the different parts of the string representation of the regular
908 - number P when SPEC.SPEC is 'e', 'E', 'g', or 'G'.
909 + number P when spec.spec is 'e', 'E', 'g', or 'G'.
910 DEC_INFO contains the previously computed exponent and string or is NULL.
911
912 return -1 if some field > INT_MAX */
913 @@ -1167,7 +1167,7 @@
914 }
915
916 /* Determine the different parts of the string representation of the regular
917 - number P when SPEC.SPEC is 'f', 'F', 'g', or 'G'.
918 + number P when spec.spec is 'f', 'F', 'g', or 'G'.
919 DEC_INFO contains the previously computed exponent and string or is NULL.
920
921 return -1 if some field of number_parts is greater than INT_MAX */
922 @@ -1559,7 +1559,7 @@
923 /* fractional part */
924 {
925 np->point = MPFR_DECIMAL_POINT;
926 - np->fp_trailing_zeros = (spec.spec == 'g' && spec.spec == 'G') ?
927 + np->fp_trailing_zeros = (spec.spec == 'g' || spec.spec == 'G') ?
928 spec.prec - 1 : spec.prec;
929 }
930 else if (spec.alt)
931 diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
932 --- mpfr-3.1.2-a/src/version.c 2013-11-15 00:51:49.211333830 +0000
933 +++ mpfr-3.1.2-b/src/version.c 2013-11-15 00:51:49.323334999 +0000
934 @@ -25,5 +25,5 @@
935 const char *
936 mpfr_get_version (void)
937 {
938 - return "3.1.2-p3";
939 + return "3.1.2-p4";
940 }
941 diff -Naurd mpfr-3.1.2-a/tests/tsprintf.c mpfr-3.1.2-b/tests/tsprintf.c
942 --- mpfr-3.1.2-a/tests/tsprintf.c 2013-03-13 15:37:44.000000000 +0000
943 +++ mpfr-3.1.2-b/tests/tsprintf.c 2013-11-15 00:51:49.267334408 +0000
944 @@ -456,10 +456,16 @@
945 check_sprintf ("1.999900 ", "%-#10.7RG", x);
946 check_sprintf ("1.9999 ", "%-10.7RG", x);
947 mpfr_set_ui (x, 1, MPFR_RNDN);
948 + check_sprintf ("1.", "%#.1Rg", x);
949 + check_sprintf ("1. ", "%-#5.1Rg", x);
950 + check_sprintf (" 1.0", "%#5.2Rg", x);
951 check_sprintf ("1.00000000000000000000000000000", "%#.30Rg", x);
952 check_sprintf ("1", "%.30Rg", x);
953 mpfr_set_ui (x, 0, MPFR_RNDN);
954 - check_sprintf ("0.000000000000000000000000000000", "%#.30Rg", x);
955 + check_sprintf ("0.", "%#.1Rg", x);
956 + check_sprintf ("0. ", "%-#5.1Rg", x);
957 + check_sprintf (" 0.0", "%#5.2Rg", x);
958 + check_sprintf ("0.00000000000000000000000000000", "%#.30Rg", x);
959 check_sprintf ("0", "%.30Rg", x);
960
961 /* following tests with precision 53 bits */