diff options
Diffstat (limited to 'ic-reals-6.3/tests/pi.c')
-rw-r--r-- | ic-reals-6.3/tests/pi.c | 20 |
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"); +} |