[go: up one dir, main page]

Struct lyon::tessellation::fixed::Fp32 []

pub struct Fp32<F = _16> {
    // some fields omitted
}

A 32 fixed point number. The size of the fractional is defined by the type parameter F.

Methods

impl<F> Fp32<F> where F: FractionalBits

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.

Smallest increment that can be reresented with this type.

Converts from a 32 bits floating point value.

Converts to a 32 bits floating point value.

Converts from a 64 bits floating point value.

Converts to a 64 bits floating point value.

Returns 1 if the number of positive, -1 if it is negative.

Returns the result of self % other.

Returns the lowest of the two values.

Returns the highest of the two values.

Returns the absolute value of this number.

Returns the same number with a different fractional precision.

impl<F> Fp32<F> where F: FractionalBits

Convert to an i32, truncating the fractional part

Computes the self * m / d in one go, avoid the precision loss from shifting bits back and forth.

Casts into a 64 bits fixed point number.

Trait Implementations

impl<F> Copy for Fp32<F>

impl<F> Clone for Fp32<F>

impl<F> PartialEq<Fp32<F>> for Fp32<F>

impl<F> Eq for Fp32<F>

impl<F> Debug for Fp32<F> where F: FractionalBits

impl<F> Display for Fp32<F> where F: FractionalBits

impl<F> Hash for Fp32<F>

impl<F> PartialOrd<Fp32<F>> for Fp32<F> where F: FractionalBits

impl<F> Ord for Fp32<F> where F: FractionalBits

impl<F> Add<Fp32<F>> for Fp32<F> where F: FractionalBits

impl<F> Sub<Fp32<F>> for Fp32<F> where F: FractionalBits

impl<F> Mul<Fp32<F>> for Fp32<F> where F: FractionalBits

impl<F> Neg for Fp32<F> where F: FractionalBits

impl<F> Mul<i32> for Fp32<F> where F: FractionalBits

impl<F> Div<i32> for Fp32<F> where F: FractionalBits

impl<F> AddAssign<Fp32<F>> for Fp32<F> where F: FractionalBits

impl<F> SubAssign<Fp32<F>> for Fp32<F> where F: FractionalBits

impl<F> Into<f32> for Fp32<F> where F: FractionalBits

impl<F> From<f32> for Fp32<F> where F: FractionalBits

impl<F> Into<f64> for Fp32<F> where F: FractionalBits

impl<F> From<f64> for Fp32<F> where F: FractionalBits

impl<F> Div<Fp32<F>> for Fp32<F> where F: FractionalBits