diff options
| author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-02-17 02:23:33 +1100 |
|---|---|---|
| committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-02-17 02:23:33 +1100 |
| commit | 876eb931dcdfa1a1e55a58f3af230062727f3c70 (patch) | |
| tree | f5ab61bfecf60c1605504631d1aaf511d7483b76 /src/libnum | |
| parent | 6fe775e2b5eaa77dd49c1d9a234c67d52e5f9087 (diff) | |
Remove Real trait and move methods into Float
This is part of the effort to simplify `std::num`, as tracked in issue #10387.
Diffstat (limited to 'src/libnum')
| -rw-r--r-- | src/libnum/complex.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libnum/complex.rs b/src/libnum/complex.rs index a832834b8e4..3755b2e43af 100644 --- a/src/libnum/complex.rs +++ b/src/libnum/complex.rs @@ -77,7 +77,7 @@ impl<T: Clone + Num> Cmplx<T> { } } -impl<T: Clone + Real> Cmplx<T> { +impl<T: Clone + Float> Cmplx<T> { /// Calculate |self| #[inline] pub fn norm(&self) -> T { @@ -85,7 +85,7 @@ impl<T: Clone + Real> Cmplx<T> { } } -impl<T: Clone + Real> Cmplx<T> { +impl<T: Clone + Float> Cmplx<T> { /// Calculate the principal Arg of self. #[inline] pub fn arg(&self) -> T { @@ -192,7 +192,7 @@ mod test { #[allow(non_uppercase_statics)]; use super::{Complex64, Cmplx}; - use std::num::{Zero,One,Real}; + use std::num::{Zero,One,Float}; pub static _0_0i : Complex64 = Cmplx { re: 0.0, im: 0.0 }; pub static _1_0i : Complex64 = Cmplx { re: 1.0, im: 0.0 }; @@ -270,9 +270,9 @@ mod test { assert!((c.arg() - arg).abs() < 1.0e-6) } test(_1_0i, 0.0); - test(_1_1i, 0.25 * Real::pi()); - test(_neg1_1i, 0.75 * Real::pi()); - test(_05_05i, 0.25 * Real::pi()); + test(_1_1i, 0.25 * Float::pi()); + test(_neg1_1i, 0.75 * Float::pi()); + test(_05_05i, 0.25 * Float::pi()); } #[test] |
