diff options
Diffstat (limited to 'src/pkg/strconv/ftoa.go')
-rw-r--r-- | src/pkg/strconv/ftoa.go | 22 |
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) |