Fix docs and function position

This commit is contained in:
Łukasz Jan Niemier 2015-12-30 10:57:54 +01:00
parent 458e9594d4
commit 8e267ee4cb
1 changed files with 6 additions and 8 deletions

View File

@ -39,6 +39,12 @@ impl<T: Clone + Num> Complex<T> {
Complex { re: re, im: im }
}
/// Returns imaginary unit
#[inline]
pub fn i() -> Complex<T> {
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<T: Clone + Num> Complex<T> {
}
}
impl<T: Clone + Num> Complex<T> {
/// Returns `i`
#[inline]
pub fn i() -> Complex<T> {
Self::new(T::zero(), T::one())
}
}
impl<T: Clone + Num + Neg<Output = T>> Complex<T> {
/// Returns the complex conjugate. i.e. `re - i im`
#[inline]