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.75 Kb · 13 lines
 1// Package uint256 implements 256-bit unsigned integer arithmetic for GnoSwap.
 2//
 3// This package provides a Uint type that represents a 256-bit unsigned integer,
 4// stored as four uint64 values in little-endian order. The unsuffixed Add, Sub,
 5// and Mul methods return the low 256 bits; AddOverflow, SubOverflow, and
 6// MulOverflow additionally report an overflow/underflow flag. MulDiv and
 7// MulDivRoundingUp panic on a zero denominator or an unrepresentable result;
 8// the rounding variant also panics if adding one to its result would overflow.
 9//
10// The implementation is optimized for gas efficiency while maintaining
11// compatibility with Ethereum's uint256 semantics, ensuring consistent
12// behavior across different blockchain environments.
13package uint256