summaryrefslogtreecommitdiff
path: root/src/pkg/strconv/ftoa.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/ftoa.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/ftoa.go')
-rw-r--r--src/pkg/strconv/ftoa.go22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/pkg/strconv/ftoa.go b/src/pkg/strconv/ftoa.go
index a6091fc6c..4ec3cdbb9 100644
--- a/src/pkg/strconv/ftoa.go
+++ b/src/pkg/strconv/ftoa.go
@@ -22,20 +22,6 @@ type floatInfo struct {
var float32info = floatInfo{23, 8, -127}
var float64info = floatInfo{52, 11, -1023}
-func floatsize() int {
- // Figure out whether float is float32 or float64.
- // 1e-35 is representable in both, but 1e-70
- // is too small for a float32.
- var f float = 1e-35
- if f*f == 0 {
- return 32
- }
- return 64
-}
-
-// Floatsize gives the size of the float type, either 32 or 64.
-var FloatSize = floatsize()
-
// Ftoa32 converts the 32-bit floating-point number f to a string,
// according to the format fmt and precision prec.
//
@@ -77,14 +63,6 @@ func FtoaN(f float64, fmt byte, prec int, n int) string {
return Ftoa64(f, fmt, prec)
}
-// Ftoa behaves as Ftoa32 or Ftoa64, depending on the size of the float type.
-func Ftoa(f float, fmt byte, prec int) string {
- if FloatSize == 32 {
- return Ftoa32(float32(f), fmt, prec)
- }
- return Ftoa64(float64(f), fmt, prec)
-}
-
func genericFtoa(bits uint64, fmt byte, prec int, flt *floatInfo) string {
neg := bits>>flt.expbits>>flt.mantbits != 0
exp := int(bits>>flt.mantbits) & (1<<flt.expbits - 1)