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.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.go')
| -rw-r--r-- | src/math/big/floatconv.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/math/big/floatconv.go b/src/math/big/floatconv.go index 95d1bf84e2..5cc9e24f4c 100644 --- a/src/math/big/floatconv.go +++ b/src/math/big/floatconv.go @@ -224,7 +224,7 @@ func (z *Float) pow5(n uint64) *Float { // sign = "+" | "-" . // prefix = "0" ( "x" | "X" | "b" | "B" ) . // mantissa = digits | digits "." [ digits ] | "." digits . -// exponent = ( "E" | "e" | "p" ) [ sign ] digits . +// exponent = ( "e" | "E" | "p" | "P" ) [ sign ] digits . // digits = digit { digit } . // digit = "0" ... "9" | "a" ... "z" | "A" ... "Z" . // infinity = [ sign ] ( "inf" | "Inf" ) . @@ -238,7 +238,7 @@ func (z *Float) pow5(n uint64) *Float { // The octal prefix "0" is not supported (a leading "0" is simply // considered a "0"). // -// A "p" exponent indicates a binary (rather then decimal) exponent; +// A "p" or "P" exponent indicates a binary (rather then decimal) exponent; // for instance "0x1.fffffffffffffp1023" (using base 0) represents the // maximum float64 value. For hexadecimal mantissae, the exponent must // be binary, if present (an "e" or "E" exponent indicator cannot be |
