aboutsummaryrefslogtreecommitdiff
path: root/tests/printf
diff options
context:
space:
mode:
authormax99x <max99x@gmail.com>2011-06-27 11:29:37 +0300
committermax99x <max99x@gmail.com>2011-06-27 11:29:37 +0300
commit6d6c9c4171fbb37dc2834d701fdb4497a7753da6 (patch)
tree59a956f465367dfe9021b5ce374c12f77febda87 /tests/printf
parent24f83c080f90dc440bd4981fc9ba5661b7bc28db (diff)
Minor printf() bugfix.
Diffstat (limited to 'tests/printf')
-rw-r--r--tests/printf/output.txt10
-rw-r--r--tests/printf/test.c10
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);