Skip to content

strconv: remove redundant type conversion #54924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/strconv/ftoaryu.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down