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

mercurial at gmplib.org mercurial at gmplib.org
Wed Feb 8 09:38:10 CET 2012


details:   /var/hg/gmp/rev/6abc61ae5aef
changeset: 14606:6abc61ae5aef
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Wed Feb 08 08:16:52 2012 +0100
description:
Typo fix in mpz_gcdext doc.

details:   /var/hg/gmp/rev/4023ebb2bfe5
changeset: 14607:4023ebb2bfe5
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Wed Feb 08 09:38:00 2012 +0100
description:
Clarified corner cases in cofactor canonicalization.

diffstat:

 ChangeLog    |   5 +++++
 doc/gmp.texi |  21 ++++++++++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r df65087c30f2 -r 4023ebb2bfe5 ChangeLog
--- a/ChangeLog	Sat Feb 04 18:22:13 2012 +0100
+++ b/ChangeLog	Wed Feb 08 09:38:00 2012 +0100
@@ -1,3 +1,8 @@
+2012-02-08  Niels Möller  <nisse at lysator.liu.se>
+
+	* doc/gmp.texi (mpz_gcdext): Clarified corner cases in cofactor
+	canonicalization.
+
 2012-02-04 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* tests/refmpn.c (refmpn_mul): More conservative allocations.
diff -r df65087c30f2 -r 4023ebb2bfe5 doc/gmp.texi
--- a/doc/gmp.texi	Sat Feb 04 18:22:13 2012 +0100
+++ b/doc/gmp.texi	Wed Feb 08 09:38:00 2012 +0100
@@ -3551,11 +3551,22 @@
 addition set @var{s} and @var{t} to coefficients satisfying
 @math{@var{a}@GMPmultiply{}@var{s} + @var{b}@GMPmultiply{}@var{t} = @var{g}}.
 The value in @var{g} is always positive, even if one or both of @var{a} and
- at var{b} are negative (or zero if both inputs are zero).  The values in @var{s} and @var{t} are chosen such that
-normally, @math{@GMPabs{@var{s}} < @GMPabs{@var{b}} / (2 @var{g})} and
- at math{@GMPabs{@var{t}} < @GMPabs{@var{a}} / (2 @var{g})}. The exceptional
-cases are that @math{@var{s} = sgn(@var{a})} if @math{@var{b} = 0} and
- at math{@var{t} = sgn(@var{b})} if @var{b = 0}.
+ at var{b} are negative (or zero if both inputs are zero). The values in @var{s}
+and @var{t} are chosen such that normally, @math{@GMPabs{@var{s}} <
+ at GMPabs{@var{b}} / (2 @var{g})} and @math{@GMPabs{@var{t}} < @GMPabs{@var{a}}
+/ (2 @var{g})}, and these relations define @var{s} and @var{t} uniquely. There
+are a few exceptional cases:
+
+If @math{@GMPabs{@var{a}} = @GMPabs{@var{b}}}, then @math{@var{s} = 0},
+ at math{@var{t} = sgn(@var{b})}.
+
+Otherwise, @math{@var{s} = sgn(@var{a})} if @math{@var{b} = 0} or
+ at math{@GMPabs{@var{b}} = 2 @var{g}}, and @math{@var{t} = sgn(@var{b})} if
+ at math{@var{a} = 0} or @math{@GMPabs{@var{a}} = 2 @var{g}}.
+
+In all cases, @math{@var{s} = 0} if and only if @math{@var{g} =
+ at GMPabs{@var{b}}}, i.e., if @var{b} divides @var{a} or @math{@var{a} = @var{b}
+= 0}. 
 
 If @var{t} is @code{NULL} then that value is not computed.
 @end deftypefun


More information about the gmp-commit mailing list