Trait Rational

Source
pub trait Rational:
    Clone
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + From<f64>
    + PartialEq
    + Debug {
    // Required method
    fn pow(self, rhs: Self) -> Self;
}
Expand description

This is the trait bounding what is necessary to be the domain/range of any generic function

Required Methods§

Source

fn pow(self, rhs: Self) -> Self

raise self to the power of rhs of same type

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Rational for f64

Source§

fn pow(self, rhs: Self) -> Self

Implementors§

Source§

impl<T: Rational + 'static> Rational for Function<T>
where Function<T>: From<f64>,