countLeadingZero become leadingZeros

This commit is contained in:
andri lim 2019-05-12 14:41:44 +07:00 committed by zah
parent 33436a5088
commit 7d74d38530
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ import
# some methods based on py-evm utils/numeric
func log2*[bits: static int](value: StUint[bits]): Natural {.inline.}=
(bits - 1) - value.countLeadingZeroBits
(bits - 1) - value.leadingZeros
func log256*(value: UInt256): Natural {.inline.}=
value.log2 shr 3 # div 8 (= log2(256), Logb x = Loga x/Loga b)