Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

math

f64 Math Operations

Mathematical functions for 32.32 fixed-point numbers. All operations are optimized for lower gas costs compared to f128.

Modules

  • ops - Basic arithmetic and mathematical operations
  • trig - Trigonometric functions (sin, cos, tan, etc.)
  • hyp - Hyperbolic functions (sinh, cosh, tanh, etc.)
  • comp - Comparison functions (min, max)
  • interest - DeFi interest calculations
  • pool - AMM pool math (constant product)
  • ratio - Ratio and proportion utilities
  • rounding - Rounding and precision control
  • lut - Lookup tables for fast computation
  • defi_precision - Precision tests for DeFi contexts

Fully qualified path: cairo_fp::f64::math

Modules

comp
defi_precision
hyp
interest
lut
ops
pool
ratio
rounding
trig