evm_clz
Scalar function
Count leading zeros: Returns the number of leading zero bits in a UINT256 value. Returns 256 for zero. Useful for finding the most significant bit position.
Overloads
evm_clz(UINT256)
Parameters
| Name | Type |
|---|---|
| x | UINT256 |
Returns
| Name | Type |
|---|---|
| leading_zeros | BIGINT |
1
SELECT 256 - evm_clz(value) AS msb_position;
Notebook ready in readonly mode.