aboutsummaryrefslogtreecommitdiff
path: root/src/strconv/atof.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/strconv/atof.go')
-rw-r--r--src/strconv/atof.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/strconv/atof.go b/src/strconv/atof.go
index 9010a66ca8..57556c7047 100644
--- a/src/strconv/atof.go
+++ b/src/strconv/atof.go
@@ -689,7 +689,7 @@ func atof64(s string) (f float64, n int, err error) {
// as their respective special floating point values. It ignores case when matching.
func ParseFloat(s string, bitSize int) (float64, error) {
f, n, err := parseFloatPrefix(s, bitSize)
- if err == nil && n != len(s) {
+ if n != len(s) && (err == nil || err.(*NumError).Err != ErrSyntax) {
return 0, syntaxError(fnParseFloat, s)
}
return f, err