diff options
author | max99x <max99x@gmail.com> | 2011-06-28 09:03:24 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-06-28 09:03:24 +0300 |
commit | bef407f174543e926033a25ee1faf69e3bdad296 (patch) | |
tree | 7de3ac62582148ec3f9771efb42ea434249842b2 /tests | |
parent | 3a0e9450e8c4f3667477b3c77f3ebc9c429963e4 (diff) |
Properly padding infinity/NaN in _formatString/printf.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/printf/output.txt | 6 | ||||
-rw-r--r-- | tests/printf/test.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/printf/output.txt b/tests/printf/output.txt index be93561b..3dd4d972 100644 --- a/tests/printf/output.txt +++ b/tests/printf/output.txt @@ -15,6 +15,12 @@ INF -INF nan NAN + nan +nan + nan +nan + inf +-inf 0 0 0.0 diff --git a/tests/printf/test.c b/tests/printf/test.c index e388ee9c..552c7e1c 100644 --- a/tests/printf/test.c +++ b/tests/printf/test.c @@ -20,6 +20,12 @@ int main() { printf("%lF\n", -INFINITY); printf("%lf\n", NAN); printf("%lF\n", NAN); + printf("%10f\n", NAN); + printf("%-10f\n", NAN); + printf("%010.2f\n", NAN); + printf("%-010.2f\n", NAN); + printf("%10.f\n", INFINITY); + printf("%-10.f\n", -INFINITY); printf("%.f\n", 0.0f); printf("%.0f\n", 0.0f); printf("%.1f\n", 0.0f); |