aboutsummaryrefslogtreecommitdiff
path: root/ic-reals-6.3/tests/exp_QInt.c
diff options
context:
space:
mode:
Diffstat (limited to 'ic-reals-6.3/tests/exp_QInt.c')
-rw-r--r--ic-reals-6.3/tests/exp_QInt.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/ic-reals-6.3/tests/exp_QInt.c b/ic-reals-6.3/tests/exp_QInt.c
new file mode 100644
index 0000000..3424a99
--- /dev/null
+++ b/ic-reals-6.3/tests/exp_QInt.c
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include "real.h"
+#include <math.h>
+
+/*
+ * Tests the exp_QInt when applied to an int rational.
+ */
+main(int argc, char *argv[])
+{
+ Real x, y;
+ int a, b;
+ double f;
+ Real makeRealSignCNQInt(Sign, char *, int, int, int);
+
+ MyName = argv[0];
+
+ if (argc != 4) {
+ fprintf(stderr, "%s <a> <b> <ndigits>\n", MyName);
+ exit(1);
+ }
+
+ initReals();
+
+ a = atoi(argv[1]);
+ b = atoi(argv[2]);
+
+ x = exp_QInt(a, b);
+
+ print_R_Dec(x, atoi(argv[3]));
+ printf("\n");
+ printf("exp(x)=%f\n", exp(f));
+}