mirror of
https://github.com/golang/go
synced 2024-09-30 14:18:32 -06:00
strconv: remove redundant type conversion
Signed-off-by: cui fliter <imcusg@gmail.com>
This commit is contained in:
parent
ed530dbd07
commit
c2c8319dd5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user