diff options
| author | Robert Griesemer <gri@golang.org> | 2019-09-17 15:45:40 -0700 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2019-09-18 04:48:34 +0000 |
| commit | 770fac4586a9c8c4647cb6ff79443ec246ae32c4 (patch) | |
| tree | 5344c470515b82ec9eb390a60366d9005cc1a143 /src/math/big/floatconv_test.go | |
| parent | 99aa56a437be4f72da2eefd2cce1c09fe8d7c201 (diff) | |
| download | go-770fac4586a9c8c4647cb6ff79443ec246ae32c4.tar.xz | |
math/big: avoid MinExp exponent wrap-around in 'x' Text format
Fixes #34343.
Change-Id: I74240c8f431f6596338633a86a7a5ee1fce70a65
Reviewed-on: https://go-review.googlesource.com/c/go/+/196057
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/math/big/floatconv_test.go')
| -rw-r--r-- | src/math/big/floatconv_test.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/math/big/floatconv_test.go b/src/math/big/floatconv_test.go index c6c6ba63e5..3aa6834143 100644 --- a/src/math/big/floatconv_test.go +++ b/src/math/big/floatconv_test.go @@ -536,6 +536,10 @@ func TestFloatText(t *testing.T) { {"-8191.53125", ToNegativeInf, 53, 'x', 4, "-0x1.fff9p+12"}, {"8191.53125", ToPositiveInf, 53, 'x', 4, "0x1.fff9p+12"}, {"-8191.53125", ToPositiveInf, 53, 'x', 4, "-0x1.fff8p+12"}, + + // issue 34343 + {"0x.8p-2147483648", ToNearestEven, 4, 'p', -1, "0x.8p-2147483648"}, + {"0x.8p-2147483648", ToNearestEven, 4, 'x', -1, "0x1p-2147483649"}, } { f, _, err := ParseFloat(test.x, 0, test.prec, ToNearestEven) if err != nil { |
