Type Definition relp_num::Rational8[][src]

type Rational8 = Ratio<u8, u8>;

Trait Implementations

impl Display for Rational8[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<&'_ i8> for Rational8[src]

#[must_use]
fn from(other: &i8) -> Self
[src]

Performs the conversion.

impl From<&'_ u8> for Rational8[src]

#[must_use]
fn from(other: &u8) -> Self
[src]

Performs the conversion.

impl From<(i8, i8)> for Rational8[src]

#[must_use]
fn from(other: (i8, i8)) -> Self
[src]

Performs the conversion.

impl From<(u8, u8)> for Rational8[src]

#[must_use]
fn from(other: (u8, u8)) -> Self
[src]

Performs the conversion.

impl From<i8> for Rational8[src]

#[must_use]
fn from(other: i8) -> Self
[src]

Performs the conversion.

impl From<u8> for Rational8[src]

#[must_use]
fn from(other: u8) -> Self
[src]

Performs the conversion.

impl FromPrimitive for Rational8[src]

#[must_use]
fn from_i64(n: i64) -> Option<Self>
[src]

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

#[must_use]
fn from_u64(n: u64) -> Option<Self>
[src]

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

#[must_use]
fn from_f32(n: f32) -> Option<Self>
[src]

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

#[must_use]
fn from_f64(n: f64) -> Option<Self>
[src]

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_isize(n: isize) -> Option<Self>[src]

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_i8(n: i8) -> Option<Self>[src]

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_i16(n: i16) -> Option<Self>[src]

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_i32(n: i32) -> Option<Self>[src]

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_i128(n: i128) -> Option<Self>[src]

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_usize(n: usize) -> Option<Self>[src]

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_u8(n: u8) -> Option<Self>[src]

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_u16(n: u16) -> Option<Self>[src]

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_u32(n: u32) -> Option<Self>[src]

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

fn from_u128(n: u128) -> Option<Self>[src]

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

impl Neg for Rational8[src]

type Output = Self

The resulting type after applying the - operator.

#[must_use]
fn neg(self) -> Self::Output
[src]

Performs the unary - operation. Read more

impl Neg for &Rational8[src]

type Output = Rational8

The resulting type after applying the - operator.

#[must_use]
fn neg(self) -> Self::Output
[src]

Performs the unary - operation. Read more

impl NonZero for Rational8[src]

#[must_use]
fn is_not_zero(&self) -> bool
[src]

Whether the value is not equal to zero. Read more

impl NonZeroSigned for Rational8[src]

#[must_use]
fn signum(&self) -> NonZeroSign
[src]

Whether the value is positive or negative.

fn is_positive(&self) -> bool[src]

Whether x > 0.

fn is_negative(&self) -> bool[src]

Whether x < 0.

impl One for Rational8[src]

#[must_use]
fn one() -> Self
[src]

Returns the multiplicative identity element of Self, 1. Read more

fn set_one(&mut self)[src]

Sets self to the multiplicative identity element of Self, 1.

#[must_use]
fn is_one(&self) -> bool
[src]

Returns true if self is equal to the multiplicative identity. Read more

impl Ord for Rational8[src]

#[must_use]
fn cmp(&self, other: &Self) -> Ordering
[src]

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

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl ToPrimitive for Rational8[src]

fn to_i64(&self) -> Option<i64>[src]

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned. Read more

fn to_u64(&self) -> Option<u64>[src]

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned. Read more

fn to_f64(&self) -> Option<f64>[src]

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more

fn to_isize(&self) -> Option<isize>[src]

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned. Read more

fn to_i8(&self) -> Option<i8>[src]

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned. Read more

fn to_i16(&self) -> Option<i16>[src]

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned. Read more

fn to_i32(&self) -> Option<i32>[src]

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned. Read more

fn to_i128(&self) -> Option<i128>[src]

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more

fn to_usize(&self) -> Option<usize>[src]

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned. Read more

fn to_u8(&self) -> Option<u8>[src]

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned. Read more

fn to_u16(&self) -> Option<u16>[src]

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned. Read more

fn to_u32(&self) -> Option<u32>[src]

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned. Read more

fn to_u128(&self) -> Option<u128>[src]

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more

fn to_f32(&self) -> Option<f32>[src]

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32. Read more

impl Zero for Rational8[src]

#[must_use]
fn zero() -> Self
[src]

Returns the additive identity element of Self, 0. Read more

fn set_zero(&mut self)[src]

Sets self to the additive identity element of Self, 0.

#[must_use]
fn is_zero(&self) -> bool
[src]

Returns true if self is equal to the additive identity.