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

mercurial at gmplib.org mercurial at gmplib.org
Thu Nov 24 22:12:24 CET 2011


details:   /var/hg/gmp-5.0/rev/b9989ca214af
changeset: 13488:b9989ca214af
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Nov 24 22:07:12 2011 +0100
description:
Update URLs, canonicalise spellng of "i.e.".

details:   /var/hg/gmp-5.0/rev/40f87ed735f0
changeset: 13489:40f87ed735f0
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Nov 24 22:07:57 2011 +0100
description:
(Formatted Output Strings): Clarify rules for mpf_t precision.

details:   /var/hg/gmp-5.0/rev/88be34345e4c
changeset: 13490:88be34345e4c
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Nov 24 22:11:01 2011 +0100
description:
(__GNU_MP_RELEASE): Renamed from typo name.

details:   /var/hg/gmp-5.0/rev/22d5620e07bb
changeset: 13491:22d5620e07bb
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Nov 24 22:11:10 2011 +0100
description:
*** empty log message ***

diffstat:

 ChangeLog    |  13 ++++++++++++
 doc/gmp.texi |  65 ++++++++++++++++++++++++++++++++---------------------------
 gmp-h.in     |   2 +-
 3 files changed, 49 insertions(+), 31 deletions(-)

diffs (254 lines):

diff -r ba05dbf85994 -r 22d5620e07bb ChangeLog
--- a/ChangeLog	Fri Jul 15 13:43:49 2011 +0200
+++ b/ChangeLog	Thu Nov 24 22:11:10 2011 +0100
@@ -1,3 +1,16 @@
+2011-11-24  Torbjorn Granlund  <tege at gmplib.org>
+
+	* doc/gmp.texi (Formatted Output Strings): Clarify rules for mpf_t
+	precision.
+
+2011-11-21  Torbjorn Granlund  <tege at gmplib.org>
+
+	* gmp-h.in (__GNU_MP_RELEASE): Renamed from typo name.
+
+2011-10-04  Torbjorn Granlund  <tege at gmplib.org>
+
+	* doc/gmp.texi (Custom Allocation): Rephrase a paragraph.
+
 2011-07-14  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/generic/dcpi1_bdiv_q.c (mpn_dcpi1_bdiv_q): Get mpn_sub_1 size
diff -r ba05dbf85994 -r 22d5620e07bb doc/gmp.texi
--- a/doc/gmp.texi	Fri Jul 15 13:43:49 2011 +0200
+++ b/doc/gmp.texi	Thu Nov 24 22:11:10 2011 +0100
@@ -2676,7 +2676,12 @@
 
 Recent versions of Valgrind are getting support for MMX and SSE/SSE2
 instructions, for past versions GMP will need to be configured not to use
-those, ie.@: for an x86 without them (for instance plain @samp{i486}).
+those, i.e.@: for an x86 without them (for instance plain @samp{i486}).
+
+GMP's assembly code sometimes promotes a read of the limbs to some larger size,
+for efficiency.  GMP will do this even at the start and end of a multilimb
+operand, using naturaly aligned operations on the larger type.  This may lead
+to benign reads outside of allocated areas, triggering complants from Valgrind.
 
 @item Other Problems
 Any suspected bug in GMP itself should be isolated to make sure it's not an
@@ -3162,7 +3167,7 @@
 @end deftypefun
 
 @deftypefun double mpz_get_d (mpz_t @var{op})
-Convert @var{op} to a @code{double}, truncating if necessary (ie.@: rounding
+Convert @var{op} to a @code{double}, truncating if necessary (i.e.@: rounding
 towards zero).
 
 If the exponent from the conversion is too big, the result is system
@@ -3171,7 +3176,7 @@
 @end deftypefun
 
 @deftypefun double mpz_get_d_2exp (signed long int *@var{exp}, mpz_t @var{op})
-Convert @var{op} to a @code{double}, truncating if necessary (ie.@: rounding
+Convert @var{op} to a @code{double}, truncating if necessary (i.e.@: rounding
 towards zero), and returning the exponent separately.
 
 The return value is in the range @math{0.5 at le{}@GMPabs{@var{d}}<1} and the
@@ -3549,9 +3554,8 @@
 @deftypefun void mpz_gcd (mpz_t @var{rop}, mpz_t @var{op1}, mpz_t @var{op2})
 @cindex Greatest common divisor functions
 @cindex GCD functions
-Set @var{rop} to the greatest common divisor of @var{op1} and @var{op2}.
-The result is always positive even if one or both input operands
-are negative.
+Set @var{rop} to the greatest common divisor of @var{op1} and @var{op2}.  The
+result is always positive even if one or both input operands are negative.
 @end deftypefun
 
 @deftypefun {unsigned long int} mpz_gcd_ui (mpz_t @var{rop}, mpz_t @var{op1}, unsigned long int @var{op2})
@@ -4264,7 +4268,7 @@
 @cindex Conversion functions
 
 @deftypefun double mpq_get_d (mpq_t @var{op})
-Convert @var{op} to a @code{double}, truncating if necessary (ie.@: rounding
+Convert @var{op} to a @code{double}, truncating if necessary (i.e.@: rounding
 towards zero).
 
 If the exponent from the conversion is too big or too small to fit a
@@ -4752,7 +4756,7 @@
 @cindex Conversion functions
 
 @deftypefun double mpf_get_d (mpf_t @var{op})
-Convert @var{op} to a @code{double}, truncating if necessary (ie.@: rounding
+Convert @var{op} to a @code{double}, truncating if necessary (i.e.@: rounding
 towards zero).
 
 If the exponent in @var{op} is too big or too small to fit a @code{double}
@@ -4762,7 +4766,7 @@
 @end deftypefun
 
 @deftypefun double mpf_get_d_2exp (signed long int *@var{exp}, mpf_t @var{op})
-Convert @var{op} to a @code{double}, truncating if necessary (ie.@: rounding
+Convert @var{op} to a @code{double}, truncating if necessary (i.e.@: rounding
 towards zero), and with an exponent returned separately.
 
 The return value is in the range @math{0.5 at le{}@GMPabs{@var{d}}<1} and the
@@ -5695,7 +5699,7 @@
 Initialize @var{state} for a linear congruential algorithm as per
 @code{gmp_randinit_lc_2exp}.  @var{a}, @var{c} and @var{m2exp} are selected
 from a table, chosen so that @var{size} bits (or more) of each @math{X} will
-be used, ie.@: @math{@var{m2exp}/2 @ge{} @var{size}}.
+be used, i.e.@: @math{@var{m2exp}/2 @ge{} @var{size}}.
 
 If successful the return value is non-zero.  If @var{size} is bigger than the
 table data provides then the return value is zero.  The maximum @var{size}
@@ -5768,7 +5772,7 @@
 @section Random State Miscellaneous
 
 @deftypefun {unsigned long} gmp_urandomb_ui (gmp_randstate_t @var{state}, unsigned long @var{n})
-Return a uniformly distributed random number of @var{n} bits, ie.@: in the
+Return a uniformly distributed random number of @var{n} bits, i.e.@: in the
 range 0 to @m{2^n-1,2^@var{n}-1} inclusive.  @var{n} must be less than or
 equal to the number of bits in an @code{unsigned long}.
 @end deftypefun
@@ -5923,7 +5927,7 @@
 Also currently there's no support for POSIX @samp{$} style numbered arguments
 (perhaps this will be added in the future).
 
-The precision field has it's usual meaning for integer @samp{Z} and float
+The precision field has its usual meaning for integer @samp{Z} and float
 @samp{F} types, but is currently undefined for @samp{Q} and should not be used
 with that.
 
@@ -5934,7 +5938,10 @@
 integer, for instance @math{2^@W{1024}} in an @code{mpf_t} of 128 bits
 precision will only produce about 40 digits, then pad with zeros to the
 decimal point.  An empty precision field like @samp{%.Fe} or @samp{%.Ff} can
-be used to specifically request just the significant digits.
+be used to specifically request just the significant digits.  Without any dot
+and thus no precision field, a precision value of 6 will be used.  Note that
+these rules mean that @samp{%Ff}, @samp{%.Ff}, and @samp{%.0Ff} will all be
+different.
 
 The decimal point character (or string) is taken from the current locale
 settings on systems which provide @code{localeconv} (@pxref{Locales,, Locales
@@ -7137,10 +7144,10 @@
 
 A @dfn{byte} here means the unit used by the @code{sizeof} operator.
 
-The @var{old_size} parameters to @var{reallocate_function} and
- at var{free_function} are passed for convenience, but of course can be ignored
-if not needed.  The default functions using @code{malloc} and friends for
-instance don't use them.
+The @var{reallocate_function} parameter @var{old_size} and the
+ at var{free_function} parameter @var{size} are passed for convenience, but of
+course they can be ignored if not needed by an implementation.  The default
+functions using @code{malloc} and friends for instance don't use them.
 
 No error return is allowed from any of these functions, if they return then
 they must have performed the specified operation.  In particular note that
@@ -7213,7 +7220,7 @@
 ALP @spaceuref{http://www-sop.inria.fr/saga/logiciels/ALP/} @* Linear algebra and
 polynomials using templates.
 @item
-Arithmos @spaceuref{http://www.win.ua.ac.be/~cant/arithmos/} @* Rationals
+Arithmos @spaceuref{http://cant.ua.ac.be/old/arithmos/} @* Rationals
 with infinities and square roots.
 @item
 CLN @spaceuref{http://www.ginac.de/CLN/} @* High level classes for arithmetic.
@@ -7393,8 +7400,7 @@
 @item
 Regina @spaceuref{http://regina.sourceforge.net/} @* Topological calculator.
 @item
-Yacas @spaceuref{http://www.xs4all.nl/~apinkus/yacas.html} @* Yet another
-computer algebra system.
+Yacas @spaceuref{yacas.sourceforge.net} @* Yet another computer algebra system.
 @end itemize
 
 @end table
@@ -7596,7 +7602,7 @@
 @end example
 @end ifnottex
 
-Let @math{b} be the power of 2 where the split occurs, ie.@: if @ms{x,0} is
+Let @math{b} be the power of 2 where the split occurs, i.e.@: if @ms{x,0} is
 @math{k} limbs (@ms{y,0} the same) then
 @m{b=2\GMPraise{$k*$@code{mp\_bits\_per\_limb}}, b=2^(k*mp_bits_per_limb)}.
 With that @m{x=x_1b+x_0,x=x1*b+x0} and @m{y=y_1b+y_0,y=y1*b+y0}, and the
@@ -7775,7 +7781,7 @@
 @end display
 
 Let @math{b} equal the power of 2 which is the size of the @ms{x,0}, @ms{x,1},
- at ms{y,0} and @ms{y,1} pieces, ie.@: if they're @math{k} limbs each then
+ at ms{y,0} and @ms{y,1} pieces, i.e.@: if they're @math{k} limbs each then
 @m{b=2\GMPraise{$k*$@code{mp\_bits\_per\_limb}}, b=2^(k*mp_bits_per_limb)}.
 With this @math{x=X(b)} and @math{y=Y(b)}.
 
@@ -8878,7 +8884,7 @@
 
 A square root must still be taken for any value that passes these tests, to
 verify it's really a square and not one of the small fraction of non-squares
-that get through (ie.@: a pseudo-square to all the tested bases).
+that get through (i.e.@: a pseudo-square to all the tested bases).
 
 Clearly more residue tests could be done, @code{mpz_perfect_square_p} only
 uses a compact and efficient set.  Big inputs would probably benefit from more
@@ -8980,7 +8986,7 @@
 
 Another possible improvement for the sub-quadratic part would be to arrange
 for radix powers that balanced the sizes of quotient and remainder produced,
-ie.@: the highest power would be an @m{b^{nk},b^(n*k)} approximately equal to
+i.e.@: the highest power would be an @m{b^{nk},b^(n*k)} approximately equal to
 @m{\sqrt{t},sqrt(t)}, not restricted to a @math{2^i} factor.  That ought to
 smooth out a graph of times against sizes, but may or may not be a net
 speedup.
@@ -10449,7 +10455,7 @@
 @item
 Richard Crandall and Carl Pomerance, ``Prime Numbers: A Computational
 Perspective'', 2nd edition, Springer-Verlag, 2005.
- at texlinebreak{} @uref{http://math.dartmouth.edu/~carlp/}
+ at texlinebreak{} @uref{http://www.math.dartmouth.edu/~carlp/}
 
 @item
 Henri Cohen, ``A Course in Computational Algebraic Number Theory'', Graduate
@@ -10482,8 +10488,8 @@
 @item
 Yves Bertot, Nicolas Magaud and Paul Zimmermann, ``A Proof of GMP Square
 Root'', Journal of Automated Reasoning, volume 29, 2002, pp.@: 225-252.  Also
-available online as INRIA Research Report 4475, June 2001,
- at uref{http://www.inria.fr/rrrt/rr-4475.html}
+available online as INRIA Research Report 4475, June 2002,
+ at uref{http://hal.inria.fr/docs/00/07/21/13/PDF/RR-4475.pdf}
 
 @item
 Christoph Burnikel and Joachim Ziegler, ``Fast Recursive Division'',
@@ -10493,8 +10499,7 @@
 @item
 Torbj@"orn Granlund and Peter L. Montgomery, ``Division by Invariant Integers
 using Multiplication'', in Proceedings of the SIGPLAN PLDI'94 Conference, June
-1994.  Also available @uref{ftp://ftp.cwi.nl/pub/pmontgom/divcnst.psa4.gz}
-(and .psl.gz).
+1994.  Also available @uref{http://gmplib.org/~tege/divcnst-pldi94.pdf}.
 
 @item
 Niels M@"oller and Torbj@"orn Granlund, ``Improved division by invariant
@@ -10574,7 +10579,7 @@
 
 @item
 Paul Zimmermann, ``Karatsuba Square Root'', INRIA Research Report 3805,
-November 1999, @uref{http://www.inria.fr/rrrt/rr-3805.html}
+November 1999, @uref{http://hal.inria.fr/inria-00072854/PDF/RR-3805.pdf}
 
 @item
 Paul Zimmermann, ``A Proof of GMP Fast Division and Square Root
diff -r ba05dbf85994 -r 22d5620e07bb gmp-h.in
--- a/gmp-h.in	Fri Jul 15 13:43:49 2011 +0200
+++ b/gmp-h.in	Thu Nov 24 22:11:10 2011 +0100
@@ -2274,7 +2274,7 @@
 #define __GNU_MP_VERSION 5
 #define __GNU_MP_VERSION_MINOR 0
 #define __GNU_MP_VERSION_PATCHLEVEL 2
-#define __GMP_MP_RELEASE (__GNU_MP_VERSION * 10000 + __GNU_MP_VERSION_MINOR * 100 + __GNU_MP_VERSION_PATCHLEVEL)
+#define __GNU_MP_RELEASE (__GNU_MP_VERSION * 10000 + __GNU_MP_VERSION_MINOR * 100 + __GNU_MP_VERSION_PATCHLEVEL)
 
 #define __GMP_H__
 #endif /* __GMP_H__ */


More information about the gmp-commit mailing list