diff options
| author | Robert Griesemer <gri@golang.org> | 2019-01-23 15:36:41 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2019-02-11 23:22:35 +0000 |
| commit | 7bc2aa670f47266d3c5a840d748a1f2e805b89d7 (patch) | |
| tree | 0bf9fb969eeb588089fb3ab9067d92ad48552acd /src/math/big/floatconv_test.go | |
| parent | 58365b34bb4d84dda4e2fe73cd9eb7e9267ed86c (diff) | |
| download | go-7bc2aa670f47266d3c5a840d748a1f2e805b89d7.tar.xz | |
math/big: permit upper-case 'P' binary exponent (not just 'p')
The current implementation accepted binary exponents but restricted
them to 'p'. This change permits both 'p' and 'P'.
R=Go1.13
Updates #29008.
Change-Id: I7a89ccb86af4438f17b0422be7cb630ffcf43272
Reviewed-on: https://go-review.googlesource.com/c/159297
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Diffstat (limited to 'src/math/big/floatconv_test.go')
| -rw-r--r-- | src/math/big/floatconv_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/math/big/floatconv_test.go b/src/math/big/floatconv_test.go index 269e2652e8..6db9bf2e46 100644 --- a/src/math/big/floatconv_test.go +++ b/src/math/big/floatconv_test.go @@ -108,6 +108,7 @@ func TestFloatSetFloat64String(t *testing.T) { {"0b001p-3", 0.125}, {"0b.001p3", 1}, {"0b0.01p2", 1}, + {"0b0.01P+2", 1}, // hexadecimal mantissa and exponent {"0x0", 0}, @@ -117,6 +118,7 @@ func TestFloatSetFloat64String(t *testing.T) { {"0xff", 255}, {"0X.8p1", 1}, {"-0X0.00008p16", -0.5}, + {"-0X0.00008P+16", -0.5}, {"0x0.0000000000001p-1022", math.SmallestNonzeroFloat64}, {"0x1.fffffffffffffp1023", math.MaxFloat64}, } { |
