strconv: ParseFloat returns out of range error on invalid suffix #46628
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, behavior inconsistency against the document.
This is an undocumented breaking change between 1.14 and 1.15.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Execute the following code.
What did you expect to see?
Just as Go <= 1.14,
The strconv.ParseFloat document says
The input
1e1000xxx
here satisfies the firstif
statement just like1e100xxx
does, so theerr.Err
should beErrSyntax
, notErrRange
. They are not syntactically well-formed.The change seems to be the side effect of 1d31f9b, which changed the error on unconsumed characters.
What did you see instead?
The text was updated successfully, but these errors were encountered: