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
type Output
The resulting type after taking the Index
root
Required Methods
Implementors
impl<Index, V, U> Root<Index> for SI<V, U> where
V: Root<Index>,
U: PartialDiv<Index>,impl<Index, V, U> Root<Index> for UCUM<V, U> where
V: Root<Index>,
U: PartialDiv<Index>,impl<Index, V, U> Root<Index> for MKS<V, U> where
V: Root<Index>,
U: PartialDiv<Index>,impl<Index, V, U> Root<Index> for CGS<V, U> where
V: Root<Index>,
U: PartialDiv<Index>,impl<Index, V, U> Root<Index> for FPS<V, U> where
V: Root<Index>,
U: PartialDiv<Index>,impl<Index: Integer> Root<Index> for f32
impl<Index: Integer> Root<Index> for f64