From 07177f48d15509c2277a71f7e52fe563839b6128 Mon Sep 17 00:00:00 2001 From: gdr Date: Sun, 21 Dec 1997 20:15:27 +0000 Subject: [PATCH] test more floating point data formats in printf --- lib/libc/tests/stdio/float1.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libc/tests/stdio/float1.c b/lib/libc/tests/stdio/float1.c index 38c0a5e..e76323a 100644 --- a/lib/libc/tests/stdio/float1.c +++ b/lib/libc/tests/stdio/float1.c @@ -3,6 +3,10 @@ int main(void) { double pi = 3.141596; - printf("pi is %f\n", pi); + printf("(f) pi is %f\n", pi); + printf("(e) pi is %e\n", pi); + printf("(g) pi is %g\n", pi); + printf("(.2g) pi is %.2g\n", pi); + printf("(.2g) pi is %.2g\n", pi / 1024. ); return 0; }