summaryrefslogtreecommitdiff
path: root/tests/refmpz.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2002-06-06 00:39:12 +0200
committerKevin Ryde <user42@zip.com.au>2002-06-06 00:39:12 +0200
commit8075922b05fcd950e8965cc136f19b4160c901cf (patch)
tree1dcd0df7015ef39fabedac80df6b207538655a7c /tests/refmpz.c
parent3fdd362ce21fca96852242540e63ae66b5a630b2 (diff)
downloadgmp-8075922b05fcd950e8965cc136f19b4160c901cf.tar.gz
* tests/misc.c, tests/refmpz.c, tests.tests.h, tests/mpz/t-cong.c:
Rename mpz_flipbit to refmpz_combit and move from misc.c to refmpz.c.
Diffstat (limited to 'tests/refmpz.c')
-rw-r--r--tests/refmpz.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/refmpz.c b/tests/refmpz.c
index dff7da027..1d71b1dff 100644
--- a/tests/refmpz.c
+++ b/tests/refmpz.c
@@ -1,6 +1,6 @@
/* Reference mpz functions.
-Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -34,6 +34,17 @@ MA 02111-1307, USA. */
#define TRACE(x)
+/* FIXME: Shouldn't use plain mpz functions in a reference routine. */
+void
+refmpz_combit (mpz_ptr r, unsigned long bit)
+{
+ if (mpz_tstbit (r, bit))
+ mpz_clrbit (r, bit);
+ else
+ mpz_setbit (r, bit);
+}
+
+
unsigned long
refmpz_hamdist (mpz_srcptr x, mpz_srcptr y)
{