Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(673)

Unified Diff: src/pkg/strconv/fp_test.go

Issue 5434095: code review 5434095: strconv: new API (Closed)
Patch Set: diff -r 23c65e5ae3ed https://go.googlecode.com/hg/ Created 13 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/strconv/atoi_test.go ('k') | src/pkg/strconv/ftoa.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/strconv/fp_test.go
===================================================================
--- a/src/pkg/strconv/fp_test.go
+++ b/src/pkg/strconv/fp_test.go
@@ -31,7 +31,7 @@
func myatof64(s string) (f float64, ok bool) {
a := strings.SplitN(s, "p", 2)
if len(a) == 2 {
- n, err := strconv.Atoi64(a[0])
+ n, err := strconv.ParseInt(a[0], 10, 64)
if err != nil {
return 0, false
}
@@ -63,7 +63,7 @@
}
return v * pow2(e), true
}
- f1, err := strconv.Atof64(s)
+ f1, err := strconv.ParseFloat(s, 64)
if err != nil {
return 0, false
}
@@ -87,7 +87,8 @@
}
return float32(float64(n) * pow2(e)), true
}
- f1, err1 := strconv.Atof32(s)
+ f64, err1 := strconv.ParseFloat(s, 32)
+ f1 := float32(f64)
if err1 != nil {
return 0, false
}
« no previous file with comments | « src/pkg/strconv/atoi_test.go ('k') | src/pkg/strconv/ftoa.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b