[−][src]Trait mathru::algebra::abstr::Abs
Abs trait
Required methods
fn abs(&self) -> Self
returns the absolute value of a field
Implementations on Foreign Types
impl Abs for f32
[src]
impl Abs for f64
[src]
Loading content...
Implementors
impl<T> Abs for Complex<T> where
T: Field + Power,
[src]
T: Field + Power,
fn abs(&self) -> Self
[src]
Absolute value of the complex number
Example
extern crate mathru; use mathru::algebra::abstr::{Ring, Abs}; use mathru::num::Complex; use mathru::algebra::abstr::cast::ToPrimitive; let a: Complex<f64> = Complex::new(1.0, 2.0); let refer: f64 = (5.0_f64).sqrt(); assert_eq!(refer, a.abs().to_f64().unwrap());