summaryrefslogtreecommitdiff
path: root/gen-fac.c
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2014-05-20 19:44:39 +0200
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2014-05-20 19:44:39 +0200
commitc223ef16d7fe706becb8c815688820a6a0fa66d6 (patch)
tree064c5d983ece8ee3b3ffa50541d3f8e580ce3ef7 /gen-fac.c
parent7850a2847129193c8fe15ba0e7105d859fe6aea8 (diff)
downloadgmp-c223ef16d7fe706becb8c815688820a6a0fa66d6.tar.gz
+1 in the init2 argument before setbit. (Thanks Niels)
Diffstat (limited to 'gen-fac.c')
-rw-r--r--gen-fac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gen-fac.c b/gen-fac.c
index b1756a611..197bdef71 100644
--- a/gen-fac.c
+++ b/gen-fac.c
@@ -1,6 +1,6 @@
/* Generate data for combinatorics: fac_ui, bin_uiui, ...
-Copyright 2002, 2011-2013 Free Software Foundation, Inc.
+Copyright 2002, 2011-2014 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -101,7 +101,7 @@ gen_consts (int numb, int nail, int limb)
ofl = b - 1;
printf
("#define ODD_FACTORIAL_TABLE_LIMIT (%lu)\n", ofl);
- mpz_init2 (mask, numb);
+ mpz_init2 (mask, numb + 1);
mpz_setbit (mask, numb);
mpz_sub_ui (mask, mask, 1);
printf