aboutsummaryrefslogtreecommitdiff
path: root/ic-reals-6.3/tests/cos_Q.c
diff options
context:
space:
mode:
authorDuncan Wilkie <antigravityd@gmail.com>2023-11-18 06:11:09 -0600
committerDuncan Wilkie <antigravityd@gmail.com>2023-11-18 06:11:09 -0600
commit11da511c784eca003deb90c23570f0873954e0de (patch)
treee14fdd3d5d6345956d67e79ae771d0633d28362b /ic-reals-6.3/tests/cos_Q.c
Initial commit.
Diffstat (limited to 'ic-reals-6.3/tests/cos_Q.c')
-rw-r--r--ic-reals-6.3/tests/cos_Q.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/ic-reals-6.3/tests/cos_Q.c b/ic-reals-6.3/tests/cos_Q.c
new file mode 100644
index 0000000..99d13c7
--- /dev/null
+++ b/ic-reals-6.3/tests/cos_Q.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include "real.h"
+#include <math.h>
+
+/*
+ * Tests the cos_QZ when applied a rational
+ */
+main(int argc, char *argv[])
+{
+ Real x, y;
+ double f;
+ mpz_t a, b;
+
+ MyName = argv[0];
+
+ if (argc != 4) {
+ fprintf(stderr, "%s <a> <b> <ndigits>\n", MyName);
+ exit(1);
+ }
+
+ initReals();
+
+ mpz_init_set_str(a, argv[1], 10);
+ mpz_init_set_str(b, argv[2], 10);
+
+ x = cos_QZ(a, b);
+
+ print_R_Dec(x, atoi(argv[3]));
+ printf("\n");
+}