Loading

evm_signextend

Scalar function

EVM SIGNEXTEND opcode: Sign-extend x from byte k. Byte k is 0-indexed from LSB. Extends sign bit through higher bytes. Returns x unchanged if k >= 31.

evm_signextend(BIGINT, UINT256)

Parameters

Name Type
k BIGINT
x UINT256

Returns

Name Type
result UINT256
1
SELECT evm_signextend(0, '0xFF'::UINT256); -- Returns 0xFFFF...FF
Notebook ready in readonly mode.