evm_set_bits
Positions of one bits in a 256-bit unsigned EVM word, ascending from bit 0. Zero gives []; UINT256_MAX gives 0 through 255. NULL propagates. A list comprehension turns a bitmap word into its members, e.g. initialized ticks of a tick bitmap word.
Example
Runs locally
{"id":"sample_5mira7","title":"Sample"}
API reference
evm_set_bits(UINT256) #
Ascending set-bit positions of a UINT256 as UTINYINT[].
Inputs
| Name | Type | Use |
|---|---|---|
x | UINT256 UINT256 word whose one bits are listed. | required positional |
Returns
| Name | Type |
|---|---|
positions | UTINYINT[] |
Set-bit positions. UTINYINT[], distinct, ascending, in [0, 255]; [] for zero; NULL for NULL. Length is evm_bit_count(x).