[Gmp-commit] /var/hg/gmp: 4 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Thu Oct 29 07:07:19 UTC 2015


details:   /var/hg/gmp/rev/a48b963b50c0
changeset: 16910:a48b963b50c0
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Thu Oct 29 07:42:05 2015 +0100
description:
demos: Stop using undocumented mpz_div_2exp in example code.

details:   /var/hg/gmp/rev/5b459c7ab84e
changeset: 16911:5b459c7ab84e
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Thu Oct 29 08:03:07 2015 +0100
description:
tests/mpf/t-pow_ui.c: Use the reference to check for size.

details:   /var/hg/gmp/rev/309596a078f1
changeset: 16912:309596a078f1
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Thu Oct 29 08:05:16 2015 +0100
description:
gmp-h.in: Update version.

details:   /var/hg/gmp/rev/3069e074a340
changeset: 16913:3069e074a340
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Thu Oct 29 08:07:16 2015 +0100
description:
ChangeLog

diffstat:

 ChangeLog            |  8 ++++++++
 demos/factorize.c    |  5 +++--
 demos/perl/GMP.xs    |  6 +++---
 gmp-h.in             |  4 ++--
 tests/mpf/t-pow_ui.c |  6 +++---
 5 files changed, 19 insertions(+), 10 deletions(-)

diffs (99 lines):

diff -r cf915e53225d -r 3069e074a340 ChangeLog
--- a/ChangeLog	Wed Oct 28 22:05:17 2015 +0100
+++ b/ChangeLog	Thu Oct 29 08:07:16 2015 +0100
@@ -1,3 +1,11 @@
+2015-10-29 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* demos/factorize.c: mpz_div_2exp => mpz_tdiv_q_2exp.
+	* demos/perl/GMP.xs: Likewise.
+	* tests/mpf/t-pow_ui.c: Use reference value to check the size.
+
+	* gmp-h.in: Update version.
+
 2015-10-28  Torbjörn Granlund  <torbjorng at google.com>
 
 	* tests/mpf/t-pow_ui.c: New file.
diff -r cf915e53225d -r 3069e074a340 demos/factorize.c
--- a/demos/factorize.c	Wed Oct 28 22:05:17 2015 +0100
+++ b/demos/factorize.c	Thu Oct 29 08:07:16 2015 +0100
@@ -1,6 +1,7 @@
 /* Factoring with Pollard's rho method.
 
-Copyright 1995, 1997-2003, 2005, 2009, 2012 Free Software Foundation, Inc.
+Copyright 1995, 1997-2003, 2005, 2009, 2012, 2015 Free Software
+Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -131,7 +132,7 @@
   mpz_init (q);
 
   p = mpz_scan1 (t, 0);
-  mpz_div_2exp (t, t, p);
+  mpz_fdiv_q_2exp (t, t, p);
   while (p)
     {
       factor_insert_ui (factors, 2);
diff -r cf915e53225d -r 3069e074a340 demos/perl/GMP.xs
--- a/demos/perl/GMP.xs	Wed Oct 28 22:05:17 2015 +0100
+++ b/demos/perl/GMP.xs	Thu Oct 29 08:07:16 2015 +0100
@@ -1,6 +1,6 @@
 /* GMP module external subroutines.
 
-Copyright 2001-2003 Free Software Foundation, Inc.
+Copyright 2001-2003, 2015 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -1627,7 +1627,7 @@
       void (*op) (mpz_ptr, mpz_srcptr, unsigned long);
     } table[] = {
       { mpz_mul_2exp }, /* 0 */
-      { mpz_div_2exp }, /* 1 */
+      { mpz_fdiv_q_2exp }, /* 1 */
       { mpz_pow_ui   }, /* 2 */
     };
 CODE:
@@ -1653,7 +1653,7 @@
       void (*op) (mpz_ptr, mpz_srcptr, unsigned long);
     } table[] = {
       { mpz_mul_2exp }, /* 0 */
-      { mpz_div_2exp }, /* 1 */
+      { mpz_fdiv_q_2exp }, /* 1 */
       { mpz_pow_ui   }, /* 2 */
     };
 PPCODE:
diff -r cf915e53225d -r 3069e074a340 gmp-h.in
--- a/gmp-h.in	Wed Oct 28 22:05:17 2015 +0100
+++ b/gmp-h.in	Thu Oct 29 08:07:16 2015 +0100
@@ -2325,8 +2325,8 @@
 
 /* Major version number is the value of __GNU_MP__ too, above and in mp.h. */
 #define __GNU_MP_VERSION            6
-#define __GNU_MP_VERSION_MINOR      0
-#define __GNU_MP_VERSION_PATCHLEVEL 99
+#define __GNU_MP_VERSION_MINOR      1
+#define __GNU_MP_VERSION_PATCHLEVEL 0
 #define __GNU_MP_RELEASE (__GNU_MP_VERSION * 10000 + __GNU_MP_VERSION_MINOR * 100 + __GNU_MP_VERSION_PATCHLEVEL)
 
 #define __GMP_H__
diff -r cf915e53225d -r 3069e074a340 tests/mpf/t-pow_ui.c
--- a/tests/mpf/t-pow_ui.c	Wed Oct 28 22:05:17 2015 +0100
+++ b/tests/mpf/t-pow_ui.c	Thu Oct 29 08:07:16 2015 +0100
@@ -43,13 +43,13 @@
 	{
 	  mpf_pow_ui (r, b1, e);
 
-	  if (mpf_cmp_ui (r, ~CNST_LIMB(0)) > 0)
-	    break;
-
 	  if (mpf_cmp (r, r2))
 	    abort ();
 
 	  mpf_mul_ui (r2, r2, b);
+
+	  if (mpf_cmp_ui (r2, GMP_NUMB_MAX) > 0)
+	    break;
 	}
     }
 


More information about the gmp-commit mailing list