diff options
| author | Robert Griesemer <gri@golang.org> | 2015-04-03 13:51:48 -0700 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2015-04-04 00:03:16 +0000 |
| commit | 09b3bf42c717d31dca05959c57d6bbf631748c8a (patch) | |
| tree | 768d09fe4b67a455d7104b90b761b23491e008c2 /src/math/big/floatconv_test.go | |
| parent | ea2c94e81e1a80677b604cb503e729ca413cd6fe (diff) | |
| download | go-09b3bf42c717d31dca05959c57d6bbf631748c8a.tar.xz | |
math/big: compute 10**exp efficiently when converting Floats
Change-Id: Ic2d9fdae43d18255c198ae62376212bdc89b75da
Reviewed-on: https://go-review.googlesource.com/8464
Reviewed-by: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/math/big/floatconv_test.go')
| -rw-r--r-- | src/math/big/floatconv_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/math/big/floatconv_test.go b/src/math/big/floatconv_test.go index e7920d0c07..96c01eed81 100644 --- a/src/math/big/floatconv_test.go +++ b/src/math/big/floatconv_test.go @@ -330,6 +330,12 @@ func TestFloatFormat(t *testing.T) { {"3e40", 100, 'f', 4, "30000000000000000000000000000000000000000.0000"}, {"3e40", 100, 'g', 40, "3e+40"}, + // make sure "stupid" exponents don't stall the machine + {"1e1000000", 64, 'p', 0, "0x.88b3a28a05eade3ap3321929"}, + {"1e1000000000", 64, 'p', 0, "0x.ecc5f45aa573d3p1538481529"}, + {"1e-1000000", 64, 'p', 0, "0x.efb4542cc8ca418ap-3321928"}, + {"1e-1000000000", 64, 'p', 0, "0x.8a64dd983a4c7dabp-1538481528"}, + // TODO(gri) need tests for actual large Floats {"0", 53, 'b', 0, "0"}, |
