aboutsummaryrefslogtreecommitdiff
path: root/ic-reals-6.3/tests/pi.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/pi.c
Initial commit.
Diffstat (limited to 'ic-reals-6.3/tests/pi.c')
-rw-r--r--ic-reals-6.3/tests/pi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ic-reals-6.3/tests/pi.c b/ic-reals-6.3/tests/pi.c
new file mode 100644
index 0000000..655e35c
--- /dev/null
+++ b/ic-reals-6.3/tests/pi.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+#include "real.h"
+
+/*
+ * Prints pi (in base 10) to the specified number of digits.
+ */
+main(int argc, char *argv[])
+{
+ MyName = argv[0];
+
+ if (argc != 2) {
+ fprintf(stderr, "%s <n>\n", MyName);
+ exit(1);
+ }
+
+ initReals();
+
+ print_R_Dec(Pi, atoi(argv[1]));
+ printf("\n");
+}