evm_clz

Counts zero bits from bit 255, the most significant bit, toward bit 0 in a 256-bit unsigned EVM word. Returns 256 for zero. NULL input propagates to NULL.

Example

Local

1
SELECT evm_clz(1::UINT256) AS result;
2
-- => [{"result":255}]
Notebook ready in readonly mode.

API reference

Exact signatures with descriptions, requirements, inputs, returns, and examples.

evm_clz(UINT256) #

Returns the UINT256 leading-zero count as BIGINT.

Inputs

Name Type Use
x UINT256

UINT256 word to scan from its most significant bit.

required positional

Returns

Name Type
leading_zeros BIGINT

Leading-zero count. BIGINT in the inclusive range 0 through 256, or NULL for NULL input.

Category and tags

Category
EVM utilities
Tag
Types
Tag
EVM