diff --git a/src/lib.rs b/src/lib.rs index 69461fd..84aae02 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -143,6 +143,16 @@ impl> Complex { #[cfg(feature = "std")] impl Complex { + /// Returns the real part. + #[inline] + pub fn real(&self) -> T { + self.re + } + /// Returns the imaginary part. + #[inline] + pub fn imag(&self) -> T { + self.im + } /// Calculate |self| #[inline] pub fn norm(&self) -> T {