diff options
author | max99x <max99x@gmail.com> | 2011-06-27 11:29:37 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-06-27 11:29:37 +0300 |
commit | 6d6c9c4171fbb37dc2834d701fdb4497a7753da6 (patch) | |
tree | 59a956f465367dfe9021b5ce374c12f77febda87 /tests/printf | |
parent | 24f83c080f90dc440bd4981fc9ba5661b7bc28db (diff) |
Minor printf() bugfix.
Diffstat (limited to 'tests/printf')
-rw-r--r-- | tests/printf/output.txt | 10 | ||||
-rw-r--r-- | tests/printf/test.c | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/printf/output.txt b/tests/printf/output.txt index dc3a875e..99e91e7f 100644 --- a/tests/printf/output.txt +++ b/tests/printf/output.txt @@ -13,6 +13,16 @@ INF -INF nan NAN +0 +0 +0.0 +0.00 +0.00000 +1 +1 +1.0 +1.00 +1.00000 1 12 123 diff --git a/tests/printf/test.c b/tests/printf/test.c index c862ae44..ac662dca 100644 --- a/tests/printf/test.c +++ b/tests/printf/test.c @@ -17,6 +17,16 @@ int main() { printf("%lF\n", -INFINITY); printf("%lf\n", NAN); printf("%lF\n", NAN); + printf("%.f\n", 0.0f); + printf("%.0f\n", 0.0f); + printf("%.1f\n", 0.0f); + printf("%.2f\n", 0.0f); + printf("%.5f\n", 0.0f); + printf("%.f\n", 1.0f); + printf("%.0f\n", 1.0f); + printf("%.1f\n", 1.0f); + printf("%.2f\n", 1.0f); + printf("%.5f\n", 1.0f); printf("%g\n", 1.f); printf("%g\n", 12.f); printf("%g\n", 123.f); |