A technique for representing fractional numbers in Solidity (which has no native floating-point). Uniswap V2 uses UQ112.112 format: the number is multiplied by 2^112, stored as uint224, and divided back when needed. This gives 112 bits of integer precision and 112 bits of fractional precision.
Solidity
Fixed-Point Arithmetic
Related terms in Solidity
Storage Packing
An EVM gas optimization where multiple state variables are packed into a single 32-byte storage slot. Reading ...
EIP-2612 Permit
A standard that allows token approvals via off-chain signatures instead of on-chain transactions. Users sign a...
Unchecked Block
A Solidity 0.8+ block where arithmetic overflow/underflow checks are disabled. Used when overflow is intention...