Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Fixed

A signed 64.64 fixed-point number.

Uses 64 bits for the integer part and 64 bits for the fractional part, providing approximately 19 decimal digits of precision.

Fields

  • mag - The absolute magnitude, scaled by 2^64
  • sign - The sign: true for negative, false for positive/zero

Example

// Create 2.5: magnitude = 2.5 * 2^64
let value = Fixed { mag: 46116860184273879040, sign: false };

Fully qualified path: cairo_fp::f128::types::fixed::Fixed

[derive(Copy, Drop, Serde)]
struct Fixed {
    mag: u128,
    sign: bool,
}

Members

mag

Fully qualified path: cairo_fp::f128::types::fixed::Fixed::mag

mag: u128

sign

Fully qualified path: cairo_fp::f128::types::fixed::Fixed::sign

sign: bool