diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-08-03 17:26:15 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-08-03 17:31:49 +0200 |
| commit | b757d264230d65f988e08158e096a09497d39eb4 (patch) | |
| tree | e20ec608a2ec8ebf603fa7aa060eb9723c4780b9 /src/pkg/strconv/atof.go | |
| parent | 5976088995f5c0d0bcada7d491fda4b6245e54e0 (diff) | |
| download | golang-b757d264230d65f988e08158e096a09497d39eb4.tar.gz | |
Imported Upstream version 2011.07.29
Diffstat (limited to 'src/pkg/strconv/atof.go')
| -rw-r--r-- | src/pkg/strconv/atof.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pkg/strconv/atof.go b/src/pkg/strconv/atof.go index a91e8bfa4..38b38053c 100644 --- a/src/pkg/strconv/atof.go +++ b/src/pkg/strconv/atof.go @@ -43,11 +43,13 @@ func special(s string) (f float64, ok bool) { switch { case equalIgnoreCase(s, "nan"): return math.NaN(), true - case equalIgnoreCase(s, "-inf"): + case equalIgnoreCase(s, "-inf"), + equalIgnoreCase(s, "-infinity"): return math.Inf(-1), true - case equalIgnoreCase(s, "+inf"): - return math.Inf(1), true - case equalIgnoreCase(s, "inf"): + case equalIgnoreCase(s, "+inf"), + equalIgnoreCase(s, "+infinity"), + equalIgnoreCase(s, "inf"), + equalIgnoreCase(s, "infinity"): return math.Inf(1), true } return |
