diff options
| author | Robert Griesemer <gri@golang.org> | 2015-09-21 15:25:52 -0700 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2015-09-22 07:59:02 +0000 |
| commit | b5d94b7d41ad003cfcf7b8849d75fc09e0c206f3 (patch) | |
| tree | 42e17883cb48f9cd862b1b293f5ba41edc07357a /src/math/big | |
| parent | 16b3675bc808095b81ee14dc4f89fb346ff1a0b0 (diff) | |
| download | go-b5d94b7d41ad003cfcf7b8849d75fc09e0c206f3.tar.xz | |
math/big: add test cases for min/max exponent values
Change-Id: I2e74e39628285e2fecaab712be6cff230619a6c2
Reviewed-on: https://go-review.googlesource.com/14778
Reviewed-by: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/math/big')
| -rw-r--r-- | src/math/big/floatconv_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/math/big/floatconv_test.go b/src/math/big/floatconv_test.go index b755b98c3a..b19152662d 100644 --- a/src/math/big/floatconv_test.go +++ b/src/math/big/floatconv_test.go @@ -367,10 +367,20 @@ func TestFloatText(t *testing.T) { // make sure "stupid" exponents don't stall the machine {"1e1000000", 64, 'p', 0, "0x.88b3a28a05eade3ap+3321929"}, + {"1e646456992", 64, 'p', 0, "0x.e883a0c5c8c7c42ap+2147483644"}, + {"1e646456993", 64, 'p', 0, "+Inf"}, {"1e1000000000", 64, 'p', 0, "+Inf"}, {"1e-1000000", 64, 'p', 0, "0x.efb4542cc8ca418ap-3321928"}, + {"1e-646456993", 64, 'p', 0, "0x.e17c8956983d9d59p-2147483647"}, + {"1e-646456994", 64, 'p', 0, "0"}, {"1e-1000000000", 64, 'p', 0, "0"}, + // minimum and maximum values + {"1p2147483646", 64, 'p', 0, "0x.8p+2147483647"}, + {"0x.8p2147483647", 64, 'p', 0, "0x.8p+2147483647"}, + {"0x.8p-2147483647", 64, 'p', 0, "0x.8p-2147483647"}, + {"1p-2147483649", 64, 'p', 0, "0x.8p-2147483648"}, + // TODO(gri) need tests for actual large Floats {"0", 53, 'b', 0, "0"}, |
