diff options
author | Luotao Fu <l.fu@pengutronix.de> | 2009-04-16 08:18:33 +0000 |
---|---|---|
committer | Luotao Fu <l.fu@pengutronix.de> | 2009-04-16 08:18:33 +0000 |
commit | 85a4462fe937086fce07fd12e367660f13ea5f42 (patch) | |
tree | 45b4fed01871a58653cd78759200b1f2c514ac50 | |
parent | 34ff04c50756668dcc771ad7eb3f8e994c43f542 (diff) | |
download | floatings-85a4462fe937086fce07fd12e367660f13ea5f42.tar.gz floatings-85a4462fe937086fce07fd12e367660f13ea5f42.tar.xz |
* fix error message printing
* always print timing information
-rw-r--r-- | src/pi8.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -225,14 +225,14 @@ int main(int argc, char *argv[]) if (argc != 2) { - printf("I need to know how many digits to compute.\n"); + fprintf(stderr, "I need to know how many digits to compute.\n"); exit(EXIT_FAILURE); } size = atol(argv[1]); if (size <= 0L) { - printf("Invalid argument.\n"); + fprintf(stderr, "Invalid argument.\n"); exit(EXIT_FAILURE); } @@ -244,7 +244,7 @@ int main(int argc, char *argv[]) if ((pi == NULL) || (powers == NULL) || (term == NULL)) { - printf("Unable to allocate enough memory.\n"); + fprintf(stderr, "Unable to allocate enough memory.\n"); exit(EXIT_FAILURE); } @@ -278,9 +278,7 @@ int main(int argc, char *argv[]) Print(pi); -#ifdef SHOWTIME printf("\nCalculation time %0.0lf\n", difftime(T2, T1)); -#endif return EXIT_SUCCESS; } |