evm_sign

Returns -1 for a negative two's-complement INT256 value, 0 for zero, and 1 for a positive value. NULL input propagates to NULL.

Example

Local

1
SELECT evm_sign((-42)::INT256) AS result;
2
-- => [{"result":-1}]
Notebook ready in readonly mode.

API reference

Exact signatures with descriptions, requirements, inputs, returns, and examples.

evm_sign(INT256) #

Returns -1, 0, or 1 for a signed INT256 input.

Inputs

Name Type Use
x INT256

Two's-complement INT256 value.

required positional

Returns

Name Type
sign BIGINT

Sign indicator. BIGINT -1, 0, or 1, or NULL for NULL input.

Category and tags

Category
EVM utilities
Tag
Types
Tag
EVM