]> Cypherpunks.ru repositories - gostls13.git/commit
strconv: clarify ParseFloat accepts Go syntax for float literals
authorBen Hoyt <benhoyt@gmail.com>
Sat, 4 Jun 2022 06:31:40 +0000 (18:31 +1200)
committerGopher Robot <gobot@golang.org>
Sat, 4 Jun 2022 21:18:25 +0000 (21:18 +0000)
commit47f806ce81aac555946144f112b9f8733e2ed871
tree346abe5180524c4e459c2f934afaf3c0c9e0157b
parent2730c6af9fb8a7dea9bf610699be0d543aed4da1
strconv: clarify ParseFloat accepts Go syntax for float literals

The documentation for strconv.ParseFloat mentions that it "accepts
decimal and hexadecimal floating-point number syntax", but it doesn't
specify what those formats entail. For example, "0x10" is not allowed;
you need an explicit exponent, as in "0x10p0".

This clarifies that ParseFloat accepts the Go syntax for floating-point
literals, and links to that spec section. I've also linked to the
relevant spec section for ParseInt's doc comment, which already said
"as defined by the Go syntax for integer literals".

Change-Id: Ib5d2b408bdd01ea0b9f69381a9dbe858f6d1d424
Reviewed-on: https://go-review.googlesource.com/c/go/+/410335
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
src/strconv/atof.go
src/strconv/atoi.go