aboutsummaryrefslogtreecommitdiff
path: root/src/math/bits
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/bits')
-rw-r--r--src/math/bits/bits.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/math/bits/bits.go b/src/math/bits/bits.go
index 76ed1d03fc..6f9142f91a 100644
--- a/src/math/bits/bits.go
+++ b/src/math/bits/bits.go
@@ -317,7 +317,7 @@ func Len16(x uint16) (n int) {
x >>= 8
n = 8
}
- return n + int(len8tab[x])
+ return n + int(len8tab[uint8(x)])
}
// Len32 returns the minimum number of bits required to represent x; the result is 0 for x == 0.
@@ -330,7 +330,7 @@ func Len32(x uint32) (n int) {
x >>= 8
n += 8
}
- return n + int(len8tab[x])
+ return n + int(len8tab[uint8(x)])
}
// Len64 returns the minimum number of bits required to represent x; the result is 0 for x == 0.
@@ -347,7 +347,7 @@ func Len64(x uint64) (n int) {
x >>= 8
n += 8
}
- return n + int(len8tab[x])
+ return n + int(len8tab[uint8(x)])
}
// --- Add with carry ---