aboutsummaryrefslogtreecommitdiff
path: root/ic-reals-6.3/tests/t3.c
diff options
context:
space:
mode:
Diffstat (limited to 'ic-reals-6.3/tests/t3.c')
-rw-r--r--ic-reals-6.3/tests/t3.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/ic-reals-6.3/tests/t3.c b/ic-reals-6.3/tests/t3.c
new file mode 100644
index 0000000..9d5dd26
--- /dev/null
+++ b/ic-reals-6.3/tests/t3.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include "real.h"
+#include <math.h>
+
+main(int argc, char *argv[])
+{
+ Real x, y, z;
+ int a, b;
+ double f;
+
+ 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 = real_QInt(a, b);
+ y = mul_R_R(x, x);
+ print_R_Dec(y, atoi(argv[3]));
+ printf("\n");
+}