pub struct ComplexF { /* private fields */ }Expand description
A floating-point complex number re + im·i, each part an f64. NOT ordered
and NOT Eq/Hash (it carries f64s); equality is exact bit-for-value.
Implementations§
Source§impl ComplexF
impl ComplexF
pub fn new(re: f64, im: f64) -> ComplexF
pub fn re(&self) -> f64
pub fn im(&self) -> f64
pub fn is_zero(&self) -> bool
pub fn negated(&self) -> ComplexF
pub fn add(&self, other: &ComplexF) -> ComplexF
pub fn sub(&self, other: &ComplexF) -> ComplexF
Sourcepub fn recip(&self) -> Option<ComplexF>
pub fn recip(&self) -> Option<ComplexF>
1/self via the conjugate over the squared magnitude — None only for zero.
Trait Implementations§
impl Copy for ComplexF
impl StructuralPartialEq for ComplexF
Auto Trait Implementations§
impl Freeze for ComplexF
impl RefUnwindSafe for ComplexF
impl Send for ComplexF
impl Sync for ComplexF
impl Unpin for ComplexF
impl UnsafeUnpin for ComplexF
impl UnwindSafe for ComplexF
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