Index: src/pkg/strconv/extfloat.go |
=================================================================== |
--- a/src/pkg/strconv/extfloat.go |
+++ b/src/pkg/strconv/extfloat.go |
@@ -139,13 +139,13 @@ |
// Extract 1+flt.mantbits bits from the 64-bit mantissa. |
mant := f.mant >> (63 - flt.mantbits) |
- if f.mant&(1<<(62-flt.mantbits)) != 0 { |
+ if f.mant&uint64(1<<(62-flt.mantbits)) != 0 { |
// Round up. |
mant += 1 |
} |
// Rounding might have added a bit; shift down. |
- if mant == 2<<flt.mantbits { |
+ if mant == uint64(2<<flt.mantbits) { |
mant >>= 1 |
exp++ |
} |
@@ -156,7 +156,7 @@ |
mant = 0 |
exp = 1<<flt.expbits - 1 + flt.bias |
overflow = true |
- } else if mant&(1<<flt.mantbits) == 0 { |
+ } else if mant&uint64(1<<flt.mantbits) == 0 { |
// Denormalized? |
exp = flt.bias |
} |
@@ -164,7 +164,7 @@ |
bits = mant & (uint64(1)<<flt.mantbits - 1) |
bits |= uint64((exp-flt.bias)&(1<<flt.expbits-1)) << flt.mantbits |
if f.neg { |
- bits |= 1 << (flt.mantbits + flt.expbits) |
+ bits |= uint64(1 << (flt.mantbits + flt.expbits)) |
} |
return |
} |
@@ -186,7 +186,7 @@ |
expBiased := exp - flt.bias |
upper = extFloat{mant: 2*f.mant + 1, exp: f.exp - 1, neg: f.neg} |
- if mant != 1<<flt.mantbits || expBiased == 1 { |
+ if mant != uint64(1<<flt.mantbits) || expBiased == 1 { |
lower = extFloat{mant: 2*f.mant - 1, exp: f.exp - 1, neg: f.neg} |
} else { |
lower = extFloat{mant: 4*f.mant - 1, exp: f.exp - 2, neg: f.neg} |
@@ -317,7 +317,7 @@ |
} |
halfway := uint64(1) << (extrabits - 1) |
- mant_extra := f.mant & (1<<extrabits - 1) |
+ mant_extra := f.mant & uint64(1<<extrabits-1) |
// Do a signed comparison here! If the error estimate could make |
// the mantissa round differently for the conversion to double, |
@@ -443,7 +443,7 @@ |
for needed > 0 { |
fraction *= 10 |
ε *= 10 // the uncertainty scales as we multiply by ten. |
- if 2*ε > 1<<shift { |
+ if 2*ε > uint64(1<<shift) { |
// the error is so large it could modify which digit to write, abort. |
return false |
} |