diff --git a/src/complex.rs b/src/complex.rs index 4a271c9..6524eb9 100644 --- a/src/complex.rs +++ b/src/complex.rs @@ -39,6 +39,12 @@ impl Complex { Complex { re: re, im: im } } + /// Returns imaginary unit + #[inline] + pub fn i() -> Complex { + Self::new(T::zero(), T::one()) + } + /// Returns the square of the norm (since `T` doesn't necessarily /// have a sqrt function), i.e. `re^2 + im^2`. #[inline] @@ -59,14 +65,6 @@ impl Complex { } } -impl Complex { - /// Returns `i` - #[inline] - pub fn i() -> Complex { - Self::new(T::zero(), T::one()) - } -} - impl> Complex { /// Returns the complex conjugate. i.e. `re - i im` #[inline]