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

mercurial at gmplib.org mercurial at gmplib.org
Thu Mar 1 18:15:01 CET 2012


details:   /var/hg/gmp/rev/93674cbe470b
changeset: 14710:93674cbe470b
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Thu Mar 01 18:05:48 2012 +0100
description:
tests/mpz/t-invert.c: Small range correction.

details:   /var/hg/gmp/rev/add9cdd53e2b
changeset: 14711:add9cdd53e2b
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Thu Mar 01 18:12:22 2012 +0100
description:
doc/gmp.texi (mpz_invert): Correctly document result range.

diffstat:

 ChangeLog            |  5 +++++
 doc/gmp.texi         |  2 +-
 tests/mpz/t-invert.c |  2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 21270e2808d8 -r add9cdd53e2b ChangeLog
--- a/ChangeLog	Thu Mar 01 17:07:50 2012 +0100
+++ b/ChangeLog	Thu Mar 01 18:12:22 2012 +0100
@@ -1,3 +1,8 @@
+2012-03-01 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* doc/gmp.texi (mpz_invert): Correctly document result range.
+	* tests/mpz/t-invert.c: Small range correction.
+
 2012-03-01  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/x86_64/mullo_basecase.asm: New file.
diff -r 21270e2808d8 -r add9cdd53e2b doc/gmp.texi
--- a/doc/gmp.texi	Thu Mar 01 17:07:50 2012 +0100
+++ b/doc/gmp.texi	Thu Mar 01 18:12:22 2012 +0100
@@ -3585,7 +3585,7 @@
 @cindex Inverse modulo functions
 Compute the inverse of @var{op1} modulo @var{op2} and put the result in
 @var{rop}.  If the inverse exists, the return value is non-zero and @var{rop}
-will satisfy @math{0 < @var{rop} < @var{op2}}.  If an inverse doesn't exist
+will satisfy @math{0 < @var{rop} < @var{@GMPabs{op2}}}.  If an inverse doesn't exist
 the return value is zero and @var{rop} is undefined.
 @end deftypefun
 
diff -r 21270e2808d8 -r add9cdd53e2b tests/mpz/t-invert.c
--- a/tests/mpz/t-invert.c	Thu Mar 01 17:07:50 2012 +0100
+++ b/tests/mpz/t-invert.c	Thu Mar 01 18:12:22 2012 +0100
@@ -69,7 +69,7 @@
 	{
 	  MPZ_CHECK_FORMAT (ainv);
 
-	  if (mpz_cmp_ui (ainv, 0) <= 0 || mpz_cmpabs (ainv, m) > 0)
+	  if (mpz_cmp_ui (ainv, 0) <= 0 || mpz_cmpabs (ainv, m) >= 0)
 	    {
 	      fprintf (stderr, "ERROR in test %d\n", test);
 	      gmp_fprintf (stderr, "Inverse out of range.\n");


More information about the gmp-commit mailing list