Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

doc.gno

0.64 Kb · 12 lines
 1// Package int256 implements 256-bit signed integer arithmetic for GnoSwap.
 2//
 3// This package provides an Int type that represents a 256-bit signed integer
 4// using two's complement representation. It supports the full range from
 5// -(2^255) to 2^255-1. The unsuffixed Add, Sub, and Mul methods return the
 6// truncated 256-bit result; AddOverflow, SubOverflow, and MulOverflow also
 7// return a signed-overflow flag.
 8//
 9// The implementation follows Ethereum's int256 semantics, ensuring compatibility
10// for cross-chain DeFi protocols. Operations are optimized for common AMM
11// calculations including tick math and price computations.
12package int256