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.

Scalar function TypesEVM

Example

Runs locally

SELECT evm_ctz(1024::UINT256) AS result;
-- => [{"result":10}]

API reference

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.