Struct lyon_core::fixed::Fp64
[−]
[src]
pub struct Fp64<F = _24> { /* fields omitted */ }A 64 bits fixed point number. The size of the fractional is defined by the type parameter F.
Methods
impl<F: FractionalBits> Fp64<F>[src]
fn raw(self) -> i64
Returns the internal representation.
This internal represenataion can be used for computations to avoid bit-shifting between each operation. The number of divisions should be equal to the number of multiplications performed in order to balance out the bit shifts that were skipped.
fn from_raw(bits: i64) -> Self
fn zero() -> Self
fn is_zero(self) -> bool
fn epsilon() -> Self
Smallest increment that can be reresented with this type.
fn from_f32(val: f32) -> Self
Converts from a 32 bits floating point value.
fn to_f32(self) -> f32
Converts to a 32 bits floating point value.
fn from_f64(val: f64) -> Self
Converts from a 64 bits floating point value.
fn to_f64(self) -> f64
Converts to a 64 bits floating point value.
fn sign(self) -> i64
Returns 1 if the number of positive, -1 if it is negative.
fn rem(self, other: Self) -> Self
Returns the result of self % other.
fn min(self, other: Self) -> Self
Returns the lowest of the two values.
fn max(self, other: Self) -> Self
Returns the highest of the two values.
fn min_max(self, other: Self) -> (Self, Self)
Returns the lowest and highest of the two values in order.
fn abs(self) -> Self
Returns the absolute value of this number.
fn to_fixed<NewF: FractionalBits>(self) -> Fp64<NewF>
Returns the same number with a different fractional precision.
impl<F: FractionalBits> Fp64<F>[src]
fn one() -> Self
fn from_i64(val: i64) -> Self
fn truncate_to_i64(self) -> i64
Convert to an i64, truncating the fractional part
fn mul_div(self, m: Self, d: Self) -> Self
Computes the self * m / d in one go, avoid the precision loss from shifting bits back and forth.
fn to_fp32<NewF: FractionalBits>(self) -> Fp32<NewF>
Casts into a 32 bits fixed point number.
Trait Implementations
impl<F> Copy for Fp64<F>[src]
impl<F> Clone for Fp64<F>[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl<F> PartialEq for Fp64<F>[src]
fn eq(&self, other: &Self) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0
This method tests for !=.
impl<F> Eq for Fp64<F>[src]
impl<F: FractionalBits> Debug for Fp64<F>[src]
impl<F: FractionalBits> Display for Fp64<F>[src]
impl<F> Hash for Fp64<F>[src]
fn hash<H: Hasher>(&self, h: &mut H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher1.3.0
Feeds a slice of this type into the state provided.
impl<F: FractionalBits> PartialOrd for Fp64<F>[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool1.0.0
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Rhs) -> bool1.0.0
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &Rhs) -> bool1.0.0
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Rhs) -> bool1.0.0
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl<F: FractionalBits> Ord for Fp64<F>[src]
fn cmp(&self, other: &Self) -> Ordering
This method returns an Ordering between self and other. Read more
impl<F: FractionalBits> Add<Fp64<F>> for Fp64<F>[src]
type Output = Self
The resulting type after applying the + operator
fn add(self, other: Self) -> Self
The method for the + operator
impl<F: FractionalBits> Sub<Fp64<F>> for Fp64<F>[src]
type Output = Self
The resulting type after applying the - operator
fn sub(self, other: Self) -> Self
The method for the - operator
impl<F: FractionalBits> Mul<Fp64<F>> for Fp64<F>[src]
type Output = Self
The resulting type after applying the * operator
fn mul(self, other: Self) -> Self
The method for the * operator
impl<F: FractionalBits> Neg for Fp64<F>[src]
type Output = Self
The resulting type after applying the - operator
fn neg(self) -> Self
The method for the unary - operator
impl<F: FractionalBits> Mul<i64> for Fp64<F>[src]
type Output = Fp64<F>
The resulting type after applying the * operator
fn mul(self, other: i64) -> Self
The method for the * operator
impl<F: FractionalBits> Div<i64> for Fp64<F>[src]
type Output = Fp64<F>
The resulting type after applying the / operator
fn div(self, other: i64) -> Self
The method for the / operator
impl<F: FractionalBits> AddAssign<Fp64<F>> for Fp64<F>[src]
fn add_assign(&mut self, other: Self)
The method for the += operator
impl<F: FractionalBits> SubAssign<Fp64<F>> for Fp64<F>[src]
fn sub_assign(&mut self, other: Self)
The method for the -= operator