pub struct Complex { /* private fields */ }
Expand description
A complex number represented by its real and imaginary parts.
Implementations§
Trait Implementations§
Source§impl Div for Complex
impl Div for Complex
Source§fn div(self, rhs: Self) -> Self
fn div(self, rhs: Self) -> Self
Divides one complex number by another.
§Parameters
rhs
: The right-hand side complex number to divide by.
§Returns
The quotient of the two complex numbers.
§Example
use iron_learn::Complex;
let a = Complex::new(1.0, 2.0);
let b = Complex::new(3.0, 4.0);
let r = a / b;
assert_eq!(Complex::new(0.44, 0.08), r);
Source§impl Numeric for Complex
Implementation of Numeric
for the Complex
type from the complex
module.
impl Numeric for Complex
Implementation of Numeric
for the Complex
type from the complex
module.
Source§impl Sub for Complex
impl Sub for Complex
Source§fn sub(self, rhs: Self) -> Self
fn sub(self, rhs: Self) -> Self
Subtracts one complex number from another.
§Parameters
rhs
: The right-hand side complex number to subtract.
§Returns
The difference of the two complex numbers.
§Example
use iron_learn::Complex;
let a = Complex::new(1.0, 2.0);
let b = Complex::new(3.0, 4.0);
let r = a - b;
assert_eq!(Complex::new(-2.0, -2.0), r);
impl Copy for Complex
impl StructuralPartialEq for Complex
Auto Trait Implementations§
impl Freeze for Complex
impl RefUnwindSafe for Complex
impl Send for Complex
impl Sync for Complex
impl Unpin for Complex
impl UnwindSafe for Complex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more