From 11da511c784eca003deb90c23570f0873954e0de Mon Sep 17 00:00:00 2001 From: Duncan Wilkie Date: Sat, 18 Nov 2023 06:11:09 -0600 Subject: Initial commit. --- ic-reals-6.3/tests/pi.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ic-reals-6.3/tests/pi.c (limited to 'ic-reals-6.3/tests/pi.c') 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 +#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", MyName); + exit(1); + } + + initReals(); + + print_R_Dec(Pi, atoi(argv[1])); + printf("\n"); +} -- cgit v1.2.3