Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

defi_precision

DeFi Precision Tests (f64)

Precision validation tests for 32.32 fixed-point power and exponential functions.

Test Coverage

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

Gas Benchmarks

Approximate L2 gas costs for f64 (32.32 fixed-point):

FunctionTypical GasNotes
exp()~97,000General exponential
exp2()~14,000Fast for integer exponents
ln()~51,000Natural logarithm
log2()~84,000Base-2 logarithm
log10()~87,000Base-10 logarithm
pow()~54,000Compound interest (int)
pow()~118,000Fractional exponent
sqrt()~39,000Square root
cbrt()~107,000Cube root (1.0 input)
cbrt()~172,000Cube root (general case)

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

Fully qualified path: cairo_fp::f64::math::defi_precision