summaryrefslogtreecommitdiff
path: root/src/pkg/strconv/atof.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-02-14 13:23:51 +0100
committerOndřej Surý <ondrej@sury.org>2011-02-14 13:23:51 +0100
commit758ff64c69e34965f8af5b2d6ffd65e8d7ab2150 (patch)
tree6d6b34f8c678862fe9b56c945a7b63f68502c245 /src/pkg/strconv/atof.go
parent3e45412327a2654a77944249962b3652e6142299 (diff)
downloadgolang-upstream/2011-02-01.1.tar.gz
Imported Upstream version 2011-02-01.1upstream/2011-02-01.1
Diffstat (limited to 'src/pkg/strconv/atof.go')
-rw-r--r--src/pkg/strconv/atof.go13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/pkg/strconv/atof.go b/src/pkg/strconv/atof.go
index bcb138f7a..72f162c51 100644
--- a/src/pkg/strconv/atof.go
+++ b/src/pkg/strconv/atof.go
@@ -243,7 +243,7 @@ out:
// Compute exact floating-point integer from d's digits.
// Caller is responsible for avoiding overflow.
func decimalAtof64Int(neg bool, d *decimal) float64 {
- f := float64(0)
+ f := 0.0
for i := 0; i < d.nd; i++ {
f = f*10 + float64(d.d[i]-'0')
}
@@ -400,17 +400,6 @@ func Atof64(s string) (f float64, err os.Error) {
return f, err
}
-// Atof is like Atof32 or Atof64, depending on the size of float.
-func Atof(s string) (f float, err os.Error) {
- if FloatSize == 32 {
- f1, err1 := Atof32(s)
- return float(f1), err1
- }
- f1, err1 := Atof64(s)
- return float(f1), err1
-}
-
-
// AtofN converts the string s to a 64-bit floating-point number,
// but it rounds the result assuming that it will be stored in a value
// of n bits (32 or 64).