f128
f128 - 64.64 Fixed-Point Arithmetic
High-precision fixed-point numbers using 128-bit representation.
Format
The f128 format uses 64 bits for the integer part and 64 bits for the fractional part, providing: - Range: approximately ±9.2 × 10¹⁸ - Precision: approximately 5 × 10⁻²⁰
Core Type
The Fixed struct represents a signed fixed-point number:
mag: The absolute magnitude scaled by 2⁶⁴sign:truefor negative,falsefor positive
Modules
types- Core types (Fixed, Vec2, Vec3, Vec4)math- Mathematical operationsops- Basic arithmetic, power, exponential, logarithmstrig- Trigonometric functionshyp- Hyperbolic functionscomp- Comparison utilities
procgen- Procedural generation (noise, random)
Example
use cairo_fp::f128::types::fixed::FixedTrait;
use cairo_fp::f128::math::ops;
let x = FixedTrait::new_unscaled(2, false); // 2.0
let result = ops::exp(x); // e² ≈ 7.389
Fully qualified path: cairo_fp::f128