Struct lyon_core::fixed::Fp32 [] [src]

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

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

Methods

impl<F: FractionalBits> Fp32<F>
[src]

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 lowest and highest of the two values in order.

Returns the absolute value of this number.

Returns the same number with a different fractional precision.

impl<F: FractionalBits> Fp32<F>
[src]

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>
[src]

impl<F> Clone for Fp32<F>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<F> PartialEq for Fp32<F>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<F> Eq for Fp32<F>
[src]

impl<F: FractionalBits> Debug for Fp32<F>
[src]

Formats the value using the given formatter.

impl<F: FractionalBits> Display for Fp32<F>
[src]

Formats the value using the given formatter. Read more

impl<F> Hash for Fp32<F>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<F: FractionalBits> PartialOrd for Fp32<F>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

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 Fp32<F>
[src]

This method returns an Ordering between self and other. Read more

🔬 This is a nightly-only experimental API. (ord_max_min)

Compares and returns the maximum of two values. Read more

🔬 This is a nightly-only experimental API. (ord_max_min)

Compares and returns the minimum of two values. Read more

impl<F: FractionalBits> Add<Fp32<F>> for Fp32<F>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<F: FractionalBits> Sub<Fp32<F>> for Fp32<F>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<F: FractionalBits> Mul<Fp32<F>> for Fp32<F>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<F: FractionalBits> Neg for Fp32<F>
[src]

The resulting type after applying the - operator

The method for the unary - operator

impl<F: FractionalBits> Mul<i32> for Fp32<F>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<F: FractionalBits> Div<i32> for Fp32<F>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<F: FractionalBits> AddAssign<Fp32<F>> for Fp32<F>
[src]

The method for the += operator

impl<F: FractionalBits> SubAssign<Fp32<F>> for Fp32<F>
[src]

The method for the -= operator

impl<F: FractionalBits> Into<f32> for Fp32<F>
[src]

Performs the conversion.

impl<F: FractionalBits> From<f32> for Fp32<F>
[src]

Performs the conversion.

impl<F: FractionalBits> Into<f64> for Fp32<F>
[src]

Performs the conversion.

impl<F: FractionalBits> From<f64> for Fp32<F>
[src]

Performs the conversion.

impl<F: FractionalBits> Div<Fp32<F>> for Fp32<F>
[src]

The resulting type after applying the / operator

The method for the / operator