diff options
author | Torbjorn Granlund <tege@gmplib.org> | 2011-08-07 21:28:02 +0200 |
---|---|---|
committer | Torbjorn Granlund <tege@gmplib.org> | 2011-08-07 21:28:02 +0200 |
commit | 174d4fd334cb6dce6a09e4ce3edb33bdd19d938a (patch) | |
tree | 996385720c9357186939de8f032050b76c39bcfe /mpz/inp_str.c | |
parent | 385eadb78463524370526fb012f38d037cb3f7fe (diff) | |
download | gmp-174d4fd334cb6dce6a09e4ce3edb33bdd19d938a.tar.gz |
Use integer fields for mp_bases logarithm tables.
Diffstat (limited to 'mpz/inp_str.c')
-rw-r--r-- | mpz/inp_str.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mpz/inp_str.c b/mpz/inp_str.c index b0ebb971f..a933eac55 100644 --- a/mpz/inp_str.c +++ b/mpz/inp_str.c @@ -5,8 +5,8 @@ REST ARE INTERNALS AND ARE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN FUTURE GNU MP RELEASES. -Copyright 1991, 1993, 1994, 1996, 1998, 2000, 2001, 2002, 2003 Free Software -Foundation, Inc. +Copyright 1991, 1993, 1994, 1996, 1998, 2000, 2001, 2002, 2003, 2011 Free +Software Foundation, Inc. This file is part of the GNU MP Library. @@ -27,6 +27,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #include <ctype.h> #include "gmp.h" #include "gmp-impl.h" +#include "longlong.h" #define digit_value_tab __gmp_digit_value_tab @@ -150,8 +151,7 @@ mpz_inp_str_nowhite (mpz_ptr x, FILE *stream, int base, int c, size_t nread) } else { - xsize = 2 + (mp_size_t) - (str_size / (GMP_NUMB_BITS * mp_bases[base].chars_per_bit_exactly)); + LIMBS_PER_DIGIT_IN_BASE (xsize, str_size, base); MPZ_REALLOC (x, xsize); /* Convert the byte array in base BASE to our bignum format. */ |