From e2d87f2ca5affab517baef8008cb80559d03e15a Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 29 Jan 2019 20:16:59 -0500 Subject: strconv: format hex floats This CL updates FormatFloat to format standard hexadecimal floating-point constants, using the 'x' and 'X' verbs. See golang.org/design/19308-number-literals for background. For #29008. Change-Id: I540b8f71d492cfdb7c58af533d357a564591f28b Reviewed-on: https://go-review.googlesource.com/c/160242 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- src/math/big/floatconv_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/math/big/floatconv_test.go') diff --git a/src/math/big/floatconv_test.go b/src/math/big/floatconv_test.go index 6db9bf2e46..154c818905 100644 --- a/src/math/big/floatconv_test.go +++ b/src/math/big/floatconv_test.go @@ -268,7 +268,7 @@ func TestFloat64Text(t *testing.T) { {32, 'g', -1, "32"}, {32, 'g', 0, "3e+01"}, - {100, 'x', -1, "%x"}, + // {100, 'x', -1, "%x"}, // {math.NaN(), 'g', -1, "NaN"}, // Float doesn't support NaNs // {-math.NaN(), 'g', -1, "NaN"}, // Float doesn't support NaNs @@ -440,8 +440,8 @@ func TestFloatText(t *testing.T) { {"-1024.0", 64, 'p', 0, "-0x.8p+11"}, // unsupported format - {"3.14", 64, 'x', 0, "%x"}, - {"-3.14", 64, 'x', 0, "%x"}, + //{"3.14", 64, 'x', 0, "%x"}, + //{"-3.14", 64, 'x', 0, "%x"}, } { f, _, err := ParseFloat(test.x, 0, test.prec, ToNearestEven) if err != nil { -- cgit v1.3