diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-05-12 15:10:05 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-05-12 15:10:05 -0400 |
commit | 51301ea856288510abd0fbdcb4aa5623ca6c8472 (patch) | |
tree | 0bad12c2ed057185ffa7732b99491dffe9500c8f /snprintf.c | |
parent | ccd91362dd6db79e1e652f2858ff8750a35192ff (diff) | |
download | libc-testsuite-51301ea856288510abd0fbdcb4aa5623ca6c8472.tar.gz |
add some printf float rounding tests
Diffstat (limited to 'snprintf.c')
-rw-r--r-- | snprintf.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -69,6 +69,14 @@ static const struct { { "%.4f", 1.06125, "1.0612" }, { "%.2f", 1.375, "1.38" }, { "%.1f", 1.375, "1.4" }, + { "%.15f", 1.1, "1.100000000000000" }, + { "%.16f", 1.1, "1.1000000000000001" }, + { "%.17f", 1.1, "1.10000000000000009" }, + { "%.2e", 1500001.0, "1.50e+06" }, + { "%.2e", 1505000.0, "1.50e+06" }, + { "%.2e", 1505000.00000095367431640625, "1.51e+06" }, + { "%.2e", 1505001.0, "1.51e+06" }, + { "%.2e", 1506000.0, "1.51e+06" }, /* correctness in DBL_DIG places */ { "%.15g", 1.23456789012345, "1.23456789012345" }, |