mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-26 01:05:15 +00:00
Update 0_beacon-chain.md
This commit is contained in:
parent
830ae3be9a
commit
a8c3c45faf
@ -1028,10 +1028,7 @@ def is_power_of_two(value: int) -> bool:
|
|||||||
"""
|
"""
|
||||||
Check if ``value`` is a power of two integer.
|
Check if ``value`` is a power of two integer.
|
||||||
"""
|
"""
|
||||||
if value == 0:
|
return (value > 0) && (value & (value - 1) == 0)
|
||||||
return False
|
|
||||||
else:
|
|
||||||
return 2**int(math.log2(value)) == value
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### `int_to_bytes1`, `int_to_bytes2`, ...
|
### `int_to_bytes1`, `int_to_bytes2`, ...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user