Trait dimensioned::traits::Root [] [src]

pub trait Root<Index> {
    type Output;
    fn root(self, idx: Index) -> Self::Output;
}

Root is used for implementing general integer roots for types that aren't necessarily preserved under root.

It uses instantiated type numbers to specify the degree, as you can see in the example below.

Example

extern crate dimensioned as dim;

fn main() {
    use dim::Root;
    use dim::typenum::P2;
    let x = 4.0.root(P2::new());
    let y = 2.0;

   assert_eq!(x, y);
}

Associated Types

The resulting type after taking the Index root

Required Methods

The method for taking the idx root

Implementors