INT256

256-bit signed EVM integer stored as a 32-byte two's-complement ABI word. Decimal string casts parse exact numeric values; 0x-prefixed strings parse raw bytes. VARCHAR output is decimal for display; use sort_key for signed ordering and BYTES/BYTES32 casts for raw ABI/storage boundaries.

Family
Signed integer
Physical
BLOB
Used by
8 functions
Examples
0 samples

Used by functions

Derived from generated function parameters and return types.

Input and output

  • 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.

    scalar function Offline 1 overload

Accepted as input

  • clmm_swap_step_x96

    Computes one Uniswap v4 SwapMath-compatible price-range step. Negative amount_remaining means exact input; non-negative means exact output. Direction is inferred from current versus target. Hooks, dynamic fee resolution, tick-crossing liquidity changes, multi-word iteration, slippage, routing, and calldata are outside this deterministic helper. The five-argument overload uses Uniswap v4's 1,000,000 fee denominator.

    scalar function Offline 2 overloads
  • evm_abi_word

    Encodes a supported scalar as exactly one 32-byte Solidity ABI word. Addresses and unsigned integers are left-padded; signed integers are sign-extended.

    scalar function Offline 1 overload
  • 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 Offline 1 overload
  • format_ether

    Human-readable helper for wei balances. Equivalent to format_units(amount, 18). Returns VARCHAR without introducing floating point conversion.

    scalar function Offline 1 overload
  • format_units

    Scales raw EVM integer balances by 10^decimals and returns a VARCHAR string representation. No floating point conversion is introduced. The default decimal scale is 18. INT256 inputs preserve signed values, and trailing fractional zeros are trimmed from the formatted string.

    scalar function Offline 4 overloads
  • length

    Returns the number of bytes in a BLOB or BLOB-backed EVM value such as ADDRESS, BYTES32, UINT256, or INT256.

    scalar function Offline 1 overload
  • sort_key

    Converts INT256/INT512/UINT256/UINT512 to a sortable BLOB for use in ORDER BY. Necessary because Determica's default BLOB ordering doesn't handle signed integers correctly. Use sort_key only inside ORDER BY or comparison-key workflows; it is not a human-readable number conversion, hash, or portable serialization.

    scalar function Offline 1 overload