summaryrefslogtreecommitdiff
path: root/tests/tpow.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2009-06-04 15:01:27 +0000
committerzimmerma <zimmerma@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2009-06-04 15:01:27 +0000
commit6a4e5870c8208c675022e983709dba0f66139e4e (patch)
tree0cd15baa966bd357704e7bf15a80c803137465c7 /tests/tpow.c
parent4c8c5c423597002a6d2367d132cb3c7b1a1ae00a (diff)
downloadmpc-6a4e5870c8208c675022e983709dba0f66139e4e.tar.gz
First version of mpc_pow. Seems to run ok, but we have problems with large
exponents, since it is doubly-exponential wrt the maximal exponent! I let Philippe fill the special cases, and add some more tests in pow.dat. The algorithm is documented both in algorithms.tex and in the source code. git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@552 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/tpow.c')
-rw-r--r--tests/tpow.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/tpow.c b/tests/tpow.c
new file mode 100644
index 0000000..56a3e9a
--- /dev/null
+++ b/tests/tpow.c
@@ -0,0 +1,37 @@
+/* test file for mpc_pow.
+
+Copyright (C) 2009 Paul Zimmermann
+
+This file is part of the MPC Library.
+
+The MPC Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at your
+option) any later version.
+
+The MPC Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the MPC Library; see the file COPYING.LIB. If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCC, f, mpc_pow);
+
+ test_start ();
+
+ data_check (f, "pow.dat");
+ tgeneric (f, 2, 1024, 7, 10);
+
+ test_end ();
+
+ return 0;
+}