Trait dimensioned::dimensioned::Pow [] [src]

pub trait Pow<Base> {
    type Output;
    fn pow(base: Base) -> Self::Output;
}

Pow is used for implementing general integer powers for types that don't impl Float and whose type signature changes when multiplying, such as Dim<D, V>.

It uses type 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 pow(base: Base) -> Self::Output

Example

use dimensioned::si::m;
use dimensioned::Pow;
use dimensioned::P3;

let x = 2.0*m;
let y = 8.0*m*m*m;
assert_eq!(P3::pow(x), y);

Implementors