Skip to content

Commit c2c8319

Browse files
committed
strconv: remove redundant type conversion
Signed-off-by: cui fliter <[email protected]>
1 parent ed530db commit c2c8319

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/strconv/ftoaryu.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func ryuFtoaFixed32(d *decimalSlice, mant uint32, exp int, prec int) {
3333
e2 := exp
3434
if b := bits.Len32(mant); b < 25 {
3535
mant <<= uint(25 - b)
36-
e2 += int(b) - 25
36+
e2 += b - 25
3737
}
3838
// Choose an exponent such that rounded mant*(2^e2)*(10^q) has
3939
// at least prec decimal digits, i.e
@@ -100,7 +100,7 @@ func ryuFtoaFixed64(d *decimalSlice, mant uint64, exp int, prec int) {
100100
e2 := exp
101101
if b := bits.Len64(mant); b < 55 {
102102
mant = mant << uint(55-b)
103-
e2 += int(b) - 55
103+
e2 += b - 55
104104
}
105105
// Choose an exponent such that rounded mant*(2^e2)*(10^q) has
106106
// at least prec decimal digits, i.e
@@ -194,7 +194,7 @@ func formatDecimal(d *decimalSlice, m uint64, trunc bool, roundUp bool, prec int
194194
}
195195
// render digits (similar to formatBits)
196196
n := uint(prec)
197-
d.nd = int(prec)
197+
d.nd = prec
198198
v := m
199199
for v >= 100 {
200200
var v1, v2 uint64

0 commit comments

Comments
 (0)