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

pub trait Root<Radicand> {
    type Output;
    fn root(radicand: Radicand) -> Self::Output;
}

Root is used for implementing general integer roots for types that don't impl Float and whose type signature changes when taking a root, such as Dim<D, V>.

It uses Peano numbers to specify the degree.

The syntax is a little bit weird and may be subject to change.

Associated Types

type Output

Required Methods

fn root(radicand: Radicand) -> Self::Output

Example

use dimensioned::si::m;
use dimensioned::{P4, Root};

let x = 2.0*m;
let y = 16.0*m*m*m*m;
assert_eq!(x, P4::root(x*x*x*x));

Implementors