mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-23 17:31:43 +01:00
Add a dozen new tests with the general theme of getting trailing
zeroes right.
This commit is contained in:
parent
1f2a0cdf58
commit
60fd7ba74a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113724
@ -141,6 +141,18 @@ main(int argc, char *argv[])
|
||||
testfmt("314159", "%g", 3.14159e5);
|
||||
testfmt("314159.", "%#g", 3.14159e5);
|
||||
|
||||
testfmt(" 9.000000e+03", "%13e", 9000.0);
|
||||
testfmt(" 9000.000000", "%12f", 9000.0);
|
||||
testfmt(" 9000", "%5g", 9000.0);
|
||||
testfmt(" 900000.", "%#8g", 900000.0);
|
||||
testfmt(" 9e+06", "%6g", 9000000.0);
|
||||
testfmt(" 9.000000e-04", "%13e", 0.0009);
|
||||
testfmt(" 0.000900", "%9f", 0.0009);
|
||||
testfmt(" 0.0009", "%7g", 0.0009);
|
||||
testfmt(" 9e-05", "%6g", 0.00009);
|
||||
testfmt(" 9.00000e-05", "%#12g", 0.00009);
|
||||
testfmt(" 9.e-05", "%#7.1g", 0.00009);
|
||||
|
||||
testfmt(" 0.0", "%4.1f", 0.0);
|
||||
testfmt("90.0", "%4.1f", 90.0);
|
||||
testfmt(" 100", "%4.0f", 100.0);
|
||||
|
Loading…
Reference in New Issue
Block a user