mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
strconv: fix %.1f, 0.09
Fixes #822. Credit to https://golang.org/cl/1442041 by danielfleischman R=rsc CC=golang-dev https://golang.org/cl/1738047
This commit is contained in:
parent
21f8ae8fec
commit
64b6a789a1
3 changed files with 21 additions and 6 deletions
|
|
@ -108,6 +108,16 @@ var ftoatests = []ftoaTest{
|
|||
ftoaTest{-math.Inf(0), 'g', -1, "-Inf"},
|
||||
|
||||
ftoaTest{-1, 'b', -1, "-4503599627370496p-52"},
|
||||
|
||||
// fixed bugs
|
||||
ftoaTest{0.9, 'f', 1, "0.9"},
|
||||
ftoaTest{0.09, 'f', 1, "0.1"},
|
||||
ftoaTest{0.0999, 'f', 1, "0.1"},
|
||||
ftoaTest{0.05, 'f', 1, "0.1"},
|
||||
ftoaTest{0.05, 'f', 0, "0"},
|
||||
ftoaTest{0.5, 'f', 1, "0.5"},
|
||||
ftoaTest{0.5, 'f', 0, "0"},
|
||||
ftoaTest{1.5, 'f', 0, "2"},
|
||||
}
|
||||
|
||||
func TestFtoa(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue