Fixed Point Arithmetic
Fixed point arithmetic is a method of representing numerical values in computer systems by using a constant number of digits after the decimal point, scaling integers to represent fractional values. Unlike floating-point representations, which can vary in precision, fixed-point arithmetic ensures that every calculation produces a deterministic result, which is critical for blockchain consensus.
By scaling tokens to a specific number of decimals, such as eighteen for Ethereum-based assets, protocols avoid the non-deterministic behavior inherent in standard computer hardware floating-point math. This approach is essential for calculating interest accrual in lending protocols or payout distributions in derivative contracts.
It provides the predictability required for auditing and verifying financial logic on-chain. Without this technique, different nodes might calculate slightly different results for the same transaction, leading to a fork in the chain.