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

mercurial at gmplib.org mercurial at gmplib.org
Thu Jan 2 20:23:32 UTC 2014


details:   /var/hg/gmp/rev/ff1bf2051380
changeset: 16150:ff1bf2051380
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Thu Jan 02 20:59:40 2014 +0100
description:
Enable mpn_sizeinbase, and make public.

details:   /var/hg/gmp/rev/a9bffcf3a610
changeset: 16151:a9bffcf3a610
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Thu Jan 02 21:23:21 2014 +0100
description:
Document mpn_sizeinbase.

diffstat:

 ChangeLog    |  8 ++++++++
 configure.ac |  3 ++-
 doc/gmp.texi |  7 +++++++
 gmp-h.in     |  3 +++
 4 files changed, 20 insertions(+), 1 deletions(-)

diffs (58 lines):

diff -r 2fd4147f2e82 -r a9bffcf3a610 ChangeLog
--- a/ChangeLog	Thu Jan 02 13:49:22 2014 +0100
+++ b/ChangeLog	Thu Jan 02 21:23:21 2014 +0100
@@ -1,3 +1,11 @@
+2014-01-02  Niels Möller  <nisse at lysator.liu.se>
+
+	* doc/gmp.texi (Low-level Functions): Document mpn_sizeinbase.
+
+	Enable previously unused mpn_sizeinbase function.
+	* configure.ac (gmp_mpn_functions): Added sizeinbase.
+	* gmp-h.in (mpn_sizeinbase): New prototype.
+
 2014-01-02  Marc Glisse  <marc.glisse at inria.fr>
 
 	* gmp-impl.h: Always include <limits.h>.
diff -r 2fd4147f2e82 -r a9bffcf3a610 configure.ac
--- a/configure.ac	Thu Jan 02 13:49:22 2014 +0100
+++ b/configure.ac	Thu Jan 02 21:23:21 2014 +0100
@@ -2800,7 +2800,8 @@
   mul mul_fft mul_n sqr mul_basecase sqr_basecase nussbaumer_mul	   \
   mulmid_basecase toom42_mulmid mulmid_n mulmid				   \
   random random2 pow_1							   \
-  rootrem sqrtrem get_str set_str scan0 scan1 popcount hamdist cmp	   \
+  rootrem sqrtrem sizeinbase get_str set_str				   \
+  scan0 scan1 popcount hamdist cmp					   \
   perfsqr perfpow							   \
   gcd_1 gcd gcdext_1 gcdext gcd_subdiv_step				   \
   gcdext_lehmer								   \
diff -r 2fd4147f2e82 -r a9bffcf3a610 doc/gmp.texi
--- a/doc/gmp.texi	Thu Jan 02 13:49:22 2014 +0100
+++ b/doc/gmp.texi	Thu Jan 02 21:23:21 2014 +0100
@@ -5521,6 +5521,13 @@
 @code{mpn_perfect_square_p}.
 @end deftypefun
 
+ at deftypefun size_t mpn_sizeinbase (const mp_limb_t *@var{xp}, mp_size_t @var{n}, int @var{base})
+Return the size of @{@var{xp}, at var{n}@} measured in number of digits in the
+given @var{base}.  @var{base} can vary from 2 to 62.  Requires @math{@var{n} > 0}
+and @math{@var{xp}[@var{n}-1] > 0}.  The result will be either exact or
+1 too big.  If @var{base} is a power of 2, the result is always exact.
+ at end deftypefun
+
 @deftypefun mp_size_t mpn_get_str (unsigned char *@var{str}, int @var{base}, mp_limb_t *@var{s1p}, mp_size_t @var{s1n})
 Convert @{@var{s1p}, @var{s1n}@} to a raw unsigned char array at @var{str} in
 base @var{base}, and return the number of characters produced.  There may be
diff -r 2fd4147f2e82 -r a9bffcf3a610 gmp-h.in
--- a/gmp-h.in	Thu Jan 02 13:49:22 2014 +0100
+++ b/gmp-h.in	Thu Jan 02 21:23:21 2014 +0100
@@ -1575,6 +1575,9 @@
 #define mpn_set_str __MPN(set_str)
 __GMP_DECLSPEC mp_size_t mpn_set_str (mp_ptr, const unsigned char *, size_t, int);
 
+#define mpn_sizeinbase __MPN(sizeinbase)
+__GMP_DECLSPEC size_t mpn_sizeinbase (mp_srcptr, mp_size_t, int);
+
 #define mpn_sqrtrem __MPN(sqrtrem)
 __GMP_DECLSPEC mp_size_t mpn_sqrtrem (mp_ptr, mp_ptr, mp_srcptr, mp_size_t);
 


More information about the gmp-commit mailing list