diff --git a/src/strconv/ftoaryu.go b/src/strconv/ftoaryu.go index b975cdc9b92e76..2e7bf71df0b66a 100644 --- a/src/strconv/ftoaryu.go +++ b/src/strconv/ftoaryu.go @@ -33,7 +33,7 @@ func ryuFtoaFixed32(d *decimalSlice, mant uint32, exp int, prec int) { e2 := exp if b := bits.Len32(mant); b < 25 { mant <<= uint(25 - b) - e2 += int(b) - 25 + e2 += b - 25 } // Choose an exponent such that rounded mant*(2^e2)*(10^q) has // at least prec decimal digits, i.e @@ -100,7 +100,7 @@ func ryuFtoaFixed64(d *decimalSlice, mant uint64, exp int, prec int) { e2 := exp if b := bits.Len64(mant); b < 55 { mant = mant << uint(55-b) - e2 += int(b) - 55 + e2 += b - 55 } // Choose an exponent such that rounded mant*(2^e2)*(10^q) has // at least prec decimal digits, i.e @@ -194,7 +194,7 @@ func formatDecimal(d *decimalSlice, m uint64, trunc bool, roundUp bool, prec int } // render digits (similar to formatBits) n := uint(prec) - d.nd = int(prec) + d.nd = prec v := m for v >= 100 { var v1, v2 uint64