Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

ops

Core Mathematical Operations (f64)

Basic arithmetic and mathematical functions for 32.32 fixed-point numbers. These are the gas-optimized versions using 64-bit arithmetic.

Arithmetic

  • abs - Absolute value
  • add - Addition
  • div - Division
  • mul - Multiplication (via operator overloading)
  • neg - Negation
  • sub - Subtraction

Rounding

  • ceil - Round up
  • floor - Round down
  • round - Round to nearest

Exponential & Logarithmic

  • exp - Natural exponential (e^x)
  • exp2 - Binary exponential (2^x)
  • ln - Natural logarithm
  • log2 - Binary logarithm
  • log10 - Common logarithm
  • pow - Power function

Roots

  • sqrt - Square root

Fully qualified path: cairo_fp::f64::math::ops

Free functions

absReturns the absolute value of a fixed-point number.
add
ceil
div
eq
exp
exp2
exp2_int
floor
ge
gt
le
ln
log2
log10
lt
mul
ne
neg
pow
pow_int
rem
round
sqrt
cbrt
sub