Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

FixedTrait

Core trait for f64 fixed-point operations.

Provides constructors, mathematical operations, trigonometric functions, and hyperbolic functions for the Fixed type.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait

trait FixedTrait

Trait functions

ZERO

Returns zero (0.0).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::ZERO

fn ZERO() -> Fixed

ONE

Returns one (1.0).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::ONE

fn ONE() -> Fixed

new

Creates a Fixed from a raw magnitude and sign.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::new

fn new(mag: u64, sign: bool) -> Fixed

new_unscaled

Creates a Fixed from an unscaled integer.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::new_unscaled

fn new_unscaled(mag: u64, sign: bool) -> Fixed

from_felt

Creates a Fixed from a felt252 (scaled value).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::from_felt

fn from_felt(val: felt252) -> Fixed

from_unscaled_felt

Creates a Fixed from an unscaled felt252.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::from_unscaled_felt

fn from_unscaled_felt(val: felt252) -> Fixed

abs

Absolute value.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::abs

fn abs(self: Fixed) -> Fixed

ceil

Ceiling (round up).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::ceil

fn ceil(self: Fixed) -> Fixed

exp

Natural exponential (e^x).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::exp

fn exp(self: Fixed) -> Fixed

exp2

Binary exponential (2^x).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::exp2

fn exp2(self: Fixed) -> Fixed

floor

Floor (round down).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::floor

fn floor(self: Fixed) -> Fixed

ln

Natural logarithm.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::ln

fn ln(self: Fixed) -> Fixed

log2

Base-2 logarithm.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::log2

fn log2(self: Fixed) -> Fixed

log10

Base-10 logarithm.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::log10

fn log10(self: Fixed) -> Fixed

pow

Power function (self^b).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::pow

fn pow(self: Fixed, b: Fixed) -> Fixed

round

Round to nearest integer.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::round

fn round(self: Fixed) -> Fixed

sqrt

Square root.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::sqrt

fn sqrt(self: Fixed) -> Fixed

acos

Arccosine.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::acos

fn acos(self: Fixed) -> Fixed

acos_fast

Arccosine (fast, lower precision).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::acos_fast

fn acos_fast(self: Fixed) -> Fixed

asin

Arcsine.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::asin

fn asin(self: Fixed) -> Fixed

asin_fast

Arcsine (fast, lower precision).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::asin_fast

fn asin_fast(self: Fixed) -> Fixed

atan

Arctangent.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::atan

fn atan(self: Fixed) -> Fixed

atan_fast

Arctangent (fast, lower precision).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::atan_fast

fn atan_fast(self: Fixed) -> Fixed

cos

Cosine.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::cos

fn cos(self: Fixed) -> Fixed

cos_fast

Cosine (fast, lower precision).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::cos_fast

fn cos_fast(self: Fixed) -> Fixed

sin

Sine.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::sin

fn sin(self: Fixed) -> Fixed

sin_fast

Sine (fast, lower precision).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::sin_fast

fn sin_fast(self: Fixed) -> Fixed

tan

Tangent.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::tan

fn tan(self: Fixed) -> Fixed

tan_fast

Tangent (fast, lower precision).

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::tan_fast

fn tan_fast(self: Fixed) -> Fixed

acosh

Inverse hyperbolic cosine.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::acosh

fn acosh(self: Fixed) -> Fixed

asinh

Inverse hyperbolic sine.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::asinh

fn asinh(self: Fixed) -> Fixed

atanh

Inverse hyperbolic tangent.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::atanh

fn atanh(self: Fixed) -> Fixed

cosh

Hyperbolic cosine.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::cosh

fn cosh(self: Fixed) -> Fixed

sinh

Hyperbolic sine.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::sinh

fn sinh(self: Fixed) -> Fixed

tanh

Hyperbolic tangent.

Fully qualified path: cairo_fp::f64::types::fixed::FixedTrait::tanh

fn tanh(self: Fixed) -> Fixed