diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-08-17 17:19:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-17 17:19:06 -0700 |
commit | 96eab1202717e073782ec399a4e0820cae15b1bb (patch) | |
tree | 011012982be971c7e9ef91466f026bc0956ac9a2 /vendor/golang.org/x/text/internal/number/decimal.go | |
parent | 2c895ee66eed626721135acfcc48254c6e3f3b29 (diff) | |
download | chat-96eab1202717e073782ec399a4e0820cae15b1bb.tar.gz chat-96eab1202717e073782ec399a4e0820cae15b1bb.tar.bz2 chat-96eab1202717e073782ec399a4e0820cae15b1bb.zip |
Updating server dependancies. (#7246)
Diffstat (limited to 'vendor/golang.org/x/text/internal/number/decimal.go')
-rw-r--r-- | vendor/golang.org/x/text/internal/number/decimal.go | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/vendor/golang.org/x/text/internal/number/decimal.go b/vendor/golang.org/x/text/internal/number/decimal.go index f6828efd0..199c7e416 100644 --- a/vendor/golang.org/x/text/internal/number/decimal.go +++ b/vendor/golang.org/x/text/internal/number/decimal.go @@ -44,21 +44,35 @@ const maxIntDigits = 20 // // Examples: // Number Decimal -// 12345 Digits: [1, 2, 3, 4, 5], Exp: 5 -// 12.345 Digits: [1, 2, 3, 4, 5], Exp: 2 -// 12000 Digits: [1, 2], Exp: 5 -// 0.00123 Digits: [1, 2, 3], Exp: -2 +// decimal +// 12345 Digits: [1, 2, 3, 4, 5], Exp: 5 End: 5 +// 12.345 Digits: [1, 2, 3, 4, 5], Exp: 2 End: 5 +// 12000 Digits: [1, 2], Exp: 5 End: 5 +// 12000.00 Digits: [1, 2], Exp: 5 End: 7 +// 0.00123 Digits: [1, 2, 3], Exp: -2 End: 3 +// 0 Digits: [], Exp: 0 End: 1 +// scientific: +// 0 Digits: [], Exp: 0, End: 1, Comma: 0 +// 1.23e4 Digits: [1, 2, 3], Exp: 5, End: 3, Comma: 1 +// engineering +// 12.3e3 Digits: [1, 2, 3], Exp: 5, End: 3, Comma: 2 type Decimal struct { Digits []byte // mantissa digits, big-endian Exp int32 // exponent - Neg bool - Inf bool // Takes precedence over Digits and Exp. - NaN bool // Takes precedence over Inf. + // End indicates the end position of the number. + End int32 // For decimals Exp <= End. For scientific len(Digits) <= End. + // Comma is used for the comma position for scientific (always 0 or 1) and + // engineering notation (always 0, 1, 2, or 3). + Comma uint8 + + Neg bool + Inf bool // Takes precedence over Digits and Exp. + NaN bool // Takes precedence over Inf. buf [maxIntDigits]byte } -// normalize retuns a new Decimal with leading and trailing zeros removed. +// normalize returns a new Decimal with leading and trailing zeros removed. func (d *Decimal) normalize() (n Decimal) { n = *d b := n.Digits |