Trait dimensioned::traits::Sqrt [] [src]

pub trait Sqrt {
    type Output;
    fn sqrt(self) -> Self::Output;
}

Sqrt provides a sqrt member function for types that are not necessarily preserved under square root.

Example

extern crate dimensioned as dim;

fn main() {
    use dim::si;
    let x = 2.0 * si::M;
    let a = 4.0 * si::M2;

    use dim::Sqrt;
    assert_eq!(a.sqrt(), x);
}

Associated Types

The resulting type after taking the square root

Required Methods

The method for taking the square root

Implementors