Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

defi_precision

DeFi Precision Tests

Precision validation tests for power and exponential functions across DeFi-typical value ranges.

Test Coverage

- Rates: 0.01% to 500% (0.0001 to 5.0) - Values: Small (1e-8) to Large (1e8)

Gas Benchmarks

Approximate L2 gas costs for f128 (64.64 fixed-point):

FunctionTypical GasNotes
exp()~176,000General exponential
exp2()~17,500Fast for integer exponents
ln()~40,000Natural logarithm
log2()~190,000Base-2 logarithm
log10()~201,000Base-10 logarithm
pow()~75,000Integer exponent
pow()~362,000Fractional exponent
sqrt()~33,000Square root
cbrt()~217,000Cube root (1.0 input)
cbrt()~363,000Cube root (general case)

This module contains tests only - no runtime functions are exported.

Fully qualified path: cairo_fp::f128::math::defi_precision