evm_ctz

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

Example

Local

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

API reference

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

evm_ctz(UINT256) #

Returns the UINT256 trailing-zero count as BIGINT.

Inputs

Name Type Use
x UINT256

UINT256 word to scan from its least significant bit.

required positional

Returns

Name Type
trailing_zeros BIGINT

Trailing-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