Struct closed01::Closed01 [] [src]

pub struct Closed01<F>(_)
where
    F: Copy + Clone + Debug + PartialEq + PartialOrd + BaseFloat
;

Encapsulates a floating point number in the range [0, 1] including both endpoints.

Methods

impl<F> Closed01<F> where
    F: Copy + Clone + Debug + PartialEq + PartialOrd + BaseFloat
[src]

Returns the smaller of the two.

Returns the greater of the two.

Returns the distance between the two numbers.

The average of two values.

Saturating add

Saturating sub

Multiplies both numbers

This scales self towards 1.0

This scales self towards 0.0

Invert the number (Mirror at 0.5; 1.0 - number).

Round the number to 0.0 or 1.0

Trait Implementations

impl<F: Copy> Copy for Closed01<F> where
    F: Copy + Clone + Debug + PartialEq + PartialOrd + BaseFloat
[src]

impl<F: Clone> Clone for Closed01<F> where
    F: Copy + Clone + Debug + PartialEq + PartialOrd + BaseFloat
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<F: Debug> Debug for Closed01<F> where
    F: Copy + Clone + Debug + PartialEq + PartialOrd + BaseFloat
[src]

Formats the value using the given formatter.

impl<F: PartialEq> PartialEq for Closed01<F> where
    F: Copy + Clone + Debug + PartialEq + PartialOrd + BaseFloat
[src]

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

This method tests for !=.

impl<F: PartialOrd> PartialOrd for Closed01<F> where
    F: Copy + Clone + Debug + PartialEq + PartialOrd + BaseFloat
[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 Into<f32> for Closed01<f32>
[src]

Performs the conversion.

impl Into<f64> for Closed01<f32>
[src]

Performs the conversion.

impl Into<f32> for Closed01<f64>
[src]

Performs the conversion.

impl Into<f64> for Closed01<f64>
[src]

Performs the conversion.

impl Rand for Closed01<f32>
[src]

Generates a random instance of this type using the specified source of randomness. Read more

impl Rand for Closed01<f64>
[src]

Generates a random instance of this type using the specified source of randomness. Read more