pub struct MpComplex { /* private fields */ }Expand description
Arbitrary-precision complex number.
Stores real and imaginary parts as MpFloat at a shared bit precision.
This mirrors enough of rug::Complex to replace its usage in
scirs2-special::arbitrary_precision.
Implementations§
Source§impl MpComplex
impl MpComplex
Sourcepub fn with_val(bits: u32, (re, im): (f64, f64)) -> Self
pub fn with_val(bits: u32, (re, im): (f64, f64)) -> Self
Create a complex number from (real, imag) f64 pair.
§Examples
use oxinum_float::mp_float::MpComplex;
let z = MpComplex::with_val(256, (1.0f64, 2.0f64));
assert!((z.real().to_f64() - 1.0).abs() < 1e-10);
assert!((z.imag().to_f64() - 2.0).abs() < 1e-10);Sourcepub fn into_real_imag(self) -> (MpFloat, MpFloat)
pub fn into_real_imag(self) -> (MpFloat, MpFloat)
Decompose into (real, imag) MpFloat pair (mirrors
rug::Complex::into_real_imag()).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MpComplex
impl RefUnwindSafe for MpComplex
impl Send for MpComplex
impl Sync for MpComplex
impl Unpin for MpComplex
impl UnsafeUnpin for MpComplex
impl UnwindSafe for MpComplex
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