evm_signextend
Implements EVM SIGNEXTEND. Byte k is indexed from the least significant byte; bit 8*k+7 is copied through all higher bits. SQL BIGINT k values below 0 or at least 31 return the unchanged UINT256 word. NULL input propagates to NULL.
Example
Local
{"id":"sample_t36qny","title":"Sample","code":"SELECT evm_signextend(0::BIGINT, '0x80'::UINT256)::VARCHAR AS result;\n-- => [{\"result\":\"115792089237316195423570985008687907853269984665640564039457584007913129639808\"}]"}
Notebook ready in readonly mode.
API reference
Exact signatures with descriptions, requirements, inputs, returns, and examples.
evm_signextend(BIGINT, UINT256) #
Sign-extends the low k+1 bytes of a UINT256 EVM word.
Category and tags
- Category
- EVM utilities
- Tag
- Types
- Tag
- EVM