From a67292f20f5248f6a189622c9d0e858942659789 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Fri, 11 Feb 2011 16:06:04 -0800 Subject: [PATCH] strconv/ftoa: avoid a double shift. (shifts by variables are expensive.) R=rsc, gri, r2 CC=golang-dev https://golang.org/cl/4169048 --- src/pkg/strconv/ftoa.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/strconv/ftoa.go b/src/pkg/strconv/ftoa.go index 4ec3cdbb97..b6049c5458 100644 --- a/src/pkg/strconv/ftoa.go +++ b/src/pkg/strconv/ftoa.go @@ -64,7 +64,7 @@ func FtoaN(f float64, fmt byte, prec int, n int) string { } func genericFtoa(bits uint64, fmt byte, prec int, flt *floatInfo) string { - neg := bits>>flt.expbits>>flt.mantbits != 0 + neg := bits>>(flt.expbits+flt.mantbits) != 0 exp := int(bits>>flt.mantbits) & (1<