evm_sar
Implements EVM SAR over a two's-complement INT256 word: right shifts with sign-bit fill. Counts at least 256 return -1 for negative x and 0 otherwise. Negative SQL BIGINT counts throw Invalid Input Error: Shift amount must be non-negative. NULL input propagates to NULL.
Example
Local
{"id":"sample_zbtl25","title":"Sample","code":"SELECT evm_sar(1::BIGINT, (-3)::INT256)::VARCHAR AS result;\n-- => [{\"result\":\"-2\"}]"}
Notebook ready in readonly mode.
API reference
Exact signatures with descriptions, requirements, inputs, returns, and examples.
evm_sar(BIGINT, INT256) #
Arithmetic right shift with sign fill over a two's-complement 256-bit word.
Category and tags
- Category
- EVM utilities
- Tag
- Types
- Tag
- EVM