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.

Scalar function TypesEVM

Example

Runs locally

SELECT evm_sign((-42)::INT256) AS result;
-- => [{"result":-1}]

API reference

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.