pub struct Complex { /* private fields */ }
Expand description
A multi-precision complex number with arbitrarily large precision and correct rounding.
The precision has to be set during construction. The rounding method of the required operations can be specified, and the direction of the rounding is returned.
§Examples
use rug::{Assign, Complex, Float};
let c = Complex::with_val(53, (40, 30));
assert_eq!(format!("{:.3}", c), "(40.0 30.0)");
let mut f = Float::with_val(53, c.abs_ref());
assert_eq!(f, 50);
f.assign(c.arg_ref());
assert_eq!(f, 0.75_f64.atan());
Operations on two borrowed Complex
numbers result in an
incomplete-computation value that has to be assigned to a new Complex
number.
use rug::Complex;
let a = Complex::with_val(53, (10.5, -11));
let b = Complex::with_val(53, (-1.25, -1.5));
let a_b_ref = &a + &b;
let a_b = Complex::with_val(53, a_b_ref);
assert_eq!(a_b, (9.25, -12.5));
As a special case, when an incomplete-computation value is obtained from
multiplying two Complex
number references, it can be added to or subtracted
from another Complex
number (or reference). This will result in a fused
multiply-accumulate operation, with only one rounding operation taking place.
use rug::Complex;
let mut acc = Complex::with_val(53, (1000, 1000));
let m1 = Complex::with_val(53, (10, 0));
let m2 = Complex::with_val(53, (1, -1));
// (1000 + 1000i) - (10 + 0i) × (1 - i) = (990 + 1010i)
acc -= &m1 * &m2;
assert_eq!(acc, (990, 1010));
The Complex
number type supports various functions. Most methods have four
versions:
- The first method consumes the operand and rounds the returned
Complex
number to the nearest representable value. - The second method has a “
_mut
” suffix, mutates the operand and rounds it the nearest representable value. - The third method has a “
_round
” suffix, mutates the operand, applies the specified rounding method to the real and imaginary parts, and returns the rounding direction for both: - The fourth method has a “
_ref
” suffix and borrows the operand. The returned item is an incomplete-computation value that can be assigned to aComplex
number; the rounding method is selected during the assignment.
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let expected = Complex::with_val(53, (1.2985, 0.6350));
// 1. consume the operand, round to nearest
let a = Complex::with_val(53, (1, 1));
let sin_a = a.sin();
assert!(*(sin_a - &expected).abs().real() < 0.0001);
// 2. mutate the operand, round to nearest
let mut b = Complex::with_val(53, (1, 1));
b.sin_mut();
assert!(*(b - &expected).abs().real() < 0.0001);
// 3. mutate the operand, apply specified rounding
let mut c = Complex::with_val(4, (1, 1));
// using 4 significant bits, 1.2985 is rounded down to 1.25
// and 0.6350 is rounded down to 0.625.
let dir = c.sin_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (1.25, 0.625));
assert_eq!(dir, (Ordering::Less, Ordering::Less));
// 4. borrow the operand
let d = Complex::with_val(53, (1, 1));
let r = d.sin_ref();
let sin_d = Complex::with_val(53, r);
assert!(*(sin_d - &expected).abs().real() < 0.0001);
// d was not consumed
assert_eq!(d, (1, 1));
Implementations§
source§impl Complex
impl Complex
sourcepub fn new<P: Prec>(prec: P) -> Self
pub fn new<P: Prec>(prec: P) -> Self
Create a new Complex
number with the specified precisions for the
real and imaginary parts and with value 0.
§Panics
Panics if the precision is out of the allowed range.
§Examples
use rug::Complex;
let c1 = Complex::new(32);
assert_eq!(c1.prec(), (32, 32));
assert_eq!(c1, 0);
let c2 = Complex::new((32, 64));
assert_eq!(c2.prec(), (32, 64));
assert_eq!(c2, 0);
sourcepub fn with_val<P, T>(prec: P, val: T) -> Self
pub fn with_val<P, T>(prec: P, val: T) -> Self
Create a new Complex
number with the specified precision and with
the given value, rounding to the nearest.
§Panics
Panics if prec
is out of the allowed range.
§Examples
use rug::Complex;
let c1 = Complex::with_val(53, (1.3f64, -12));
assert_eq!(c1.prec(), (53, 53));
assert_eq!(c1, (1.3f64, -12));
let c2 = Complex::with_val(53, 42.0);
assert_eq!(c2.prec(), (53, 53));
assert_eq!(c2, 42);
assert_eq!(c2, (42, 0));
sourcepub fn with_val_round<P, T>(
prec: P,
val: T,
round: (Round, Round),
) -> (Self, (Ordering, Ordering))
pub fn with_val_round<P, T>( prec: P, val: T, round: (Round, Round), ) -> (Self, (Ordering, Ordering))
Create a new Complex
number with the specified precision and with
the given value, applying the specified rounding method.
§Panics
Panics if prec
is out of the allowed range.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let round = (Round::Down, Round::Up);
let (c, dir) = Complex::with_val_round(4, (3.3, 2.3), round);
// 3.3 is rounded down to 3.25, 2.3 is rounded up to 2.5
assert_eq!(c.prec(), (4, 4));
assert_eq!(c, (3.25, 2.5));
assert_eq!(dir, (Ordering::Less, Ordering::Greater));
sourcepub const fn prec(&self) -> (u32, u32)
pub const fn prec(&self) -> (u32, u32)
Returns the precision of the real and imaginary parts.
§Examples
use rug::Complex;
let r = Complex::new((24, 53));
assert_eq!(r.prec(), (24, 53));
sourcepub fn set_prec_round<P: Prec>(
&mut self,
prec: P,
round: (Round, Round),
) -> (Ordering, Ordering)
pub fn set_prec_round<P: Prec>( &mut self, prec: P, round: (Round, Round), ) -> (Ordering, Ordering)
Sets the precision of the real and imaginary parts, applying the specified rounding method.
§Panics
Panics if the precision is out of the allowed range.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let mut r = Complex::with_val(6, (4.875, 4.625));
assert_eq!(r, (4.875, 4.625));
let dir = r.set_prec_round(4, (Round::Down, Round::Up));
assert_eq!(r, (4.5, 5.0));
assert_eq!(dir, (Ordering::Less, Ordering::Greater));
sourcepub fn new_64<P: Prec64>(prec: P) -> Self
pub fn new_64<P: Prec64>(prec: P) -> Self
Create a new Complex
number with the specified precisions for the
real and imaginary parts and with value 0.
§Panics
Panics if the precision is out of the allowed range.
§Examples
use rug::Complex;
let c1 = Complex::new_64(32);
assert_eq!(c1.prec_64(), (32, 32));
assert_eq!(c1, 0);
let c2 = Complex::new_64((32, 64));
assert_eq!(c2.prec_64(), (32, 64));
assert_eq!(c2, 0);
sourcepub fn with_val_64<P, T>(prec: P, val: T) -> Self
pub fn with_val_64<P, T>(prec: P, val: T) -> Self
Create a new Complex
number with the specified precision and with
the given value, rounding to the nearest.
§Panics
Panics if prec
is out of the allowed range.
§Examples
use rug::Complex;
let c1 = Complex::with_val_64(53, (1.3f64, -12));
assert_eq!(c1.prec_64(), (53, 53));
assert_eq!(c1, (1.3f64, -12));
let c2 = Complex::with_val_64(53, 42.0);
assert_eq!(c2.prec_64(), (53, 53));
assert_eq!(c2, 42);
assert_eq!(c2, (42, 0));
sourcepub fn with_val_round_64<P, T>(
prec: P,
val: T,
round: (Round, Round),
) -> (Self, (Ordering, Ordering))
pub fn with_val_round_64<P, T>( prec: P, val: T, round: (Round, Round), ) -> (Self, (Ordering, Ordering))
Create a new Complex
number with the specified precision and with
the given value, applying the specified rounding method.
§Panics
Panics if prec
is out of the allowed range.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let round = (Round::Down, Round::Up);
let (c, dir) = Complex::with_val_round_64(4, (3.3, 2.3), round);
// 3.3 is rounded down to 3.25, 2.3 is rounded up to 2.5
assert_eq!(c.prec_64(), (4, 4));
assert_eq!(c, (3.25, 2.5));
assert_eq!(dir, (Ordering::Less, Ordering::Greater));
sourcepub const fn prec_64(&self) -> (u64, u64)
pub const fn prec_64(&self) -> (u64, u64)
Returns the precision of the real and imaginary parts.
§Examples
use rug::Complex;
let r = Complex::new_64((24, 53));
assert_eq!(r.prec_64(), (24, 53));
sourcepub fn set_prec_64<P: Prec64>(&mut self, prec: P)
pub fn set_prec_64<P: Prec64>(&mut self, prec: P)
sourcepub fn set_prec_round_64<P: Prec64>(
&mut self,
prec: P,
round: (Round, Round),
) -> (Ordering, Ordering)
pub fn set_prec_round_64<P: Prec64>( &mut self, prec: P, round: (Round, Round), ) -> (Ordering, Ordering)
Sets the precision of the real and imaginary parts, applying the specified rounding method.
§Panics
Panics if the precision is out of the allowed range.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let mut r = Complex::with_val_64(6, (4.875, 4.625));
assert_eq!(r, (4.875, 4.625));
let dir = r.set_prec_round_64(4, (Round::Down, Round::Up));
assert_eq!(r, (4.5, 5.0));
assert_eq!(dir, (Ordering::Less, Ordering::Greater));
sourcepub const unsafe fn from_raw(raw: mpc_t) -> Self
pub const unsafe fn from_raw(raw: mpc_t) -> Self
Creates a Complex
number from an initialized MPC complex
number.
§Safety
- The function must not be used to create a constant
Complex
number, though it can be used to create a staticComplex
number. This is because constant values are copied on use, leading to undefined behavior when they are dropped. - The value must be initialized as a valid
mpc_t
. - The
mpc_t
type can be considered as a kind of pointer, so there can be multiple copies of it. Since this function takes over ownership, no other copies of the passed value should exist.
§Examples
use gmp_mpfr_sys::mpc;
use core::mem::MaybeUninit;
use rug::Complex;
let c = unsafe {
let mut m = MaybeUninit::uninit();
mpc::init3(m.as_mut_ptr(), 53, 53);
let mut m = m.assume_init();
mpc::set_d_d(&mut m, -14.5, 3.25, mpc::RNDNN);
// m is initialized and unique
Complex::from_raw(m)
};
assert_eq!(c, (-14.5, 3.25));
// since c is a Complex now, deallocation is automatic
This can be used to create a static Complex
number. See mpc_t
,
mpfr_t
and the MPFR documentation for details.
use core::ptr::NonNull;
use gmp_mpfr_sys::gmp::limb_t;
use gmp_mpfr_sys::mpfr::{mpfr_t, prec_t};
use gmp_mpfr_sys::mpc::mpc_t;
use rug::{Complex, Float};
const LIMBS: [limb_t; 2] = [5, 1 << (limb_t::BITS - 1)];
const LIMBS_PTR: *const [limb_t; 2] = &LIMBS;
const MANTISSA_DIGITS: u32 = limb_t::BITS * 2;
const MPC: mpc_t = mpc_t {
re: mpfr_t {
prec: MANTISSA_DIGITS as prec_t,
sign: -1,
exp: 1,
d: unsafe { NonNull::new_unchecked(LIMBS_PTR.cast_mut().cast()) },
},
im: mpfr_t {
prec: MANTISSA_DIGITS as prec_t,
sign: 1,
exp: 1,
d: unsafe { NonNull::new_unchecked(LIMBS_PTR.cast_mut().cast()) },
},
};
// Must *not* be const, otherwise it would lead to undefined
// behavior on use, as it would create a copy that is dropped.
static C: Complex = unsafe { Complex::from_raw(MPC) };
let lsig = Float::with_val(MANTISSA_DIGITS, 5) >> (MANTISSA_DIGITS - 1);
let msig = 1u32;
let val = lsig + msig;
let check = Complex::from((-val.clone(), val));
assert_eq!(C, check);
sourcepub const fn into_raw(self) -> mpc_t
pub const fn into_raw(self) -> mpc_t
Converts a Complex
number into an MPC complex number.
The returned object should be freed to avoid memory leaks.
§Examples
use gmp_mpfr_sys::mpc;
use gmp_mpfr_sys::mpfr;
use gmp_mpfr_sys::mpfr::rnd_t;
use rug::Complex;
let c = Complex::with_val(53, (-14.5, 3.25));
let mut m = c.into_raw();
unsafe {
let re_ptr = mpc::realref_const(&m);
let re = mpfr::get_d(re_ptr, rnd_t::RNDN);
assert_eq!(re, -14.5);
let im_ptr = mpc::imagref_const(&m);
let im = mpfr::get_d(im_ptr, rnd_t::RNDN);
assert_eq!(im, 3.25);
// free object to prevent memory leak
mpc::clear(&mut m);
}
sourcepub const fn as_raw(&self) -> *const mpc_t
pub const fn as_raw(&self) -> *const mpc_t
Returns a pointer to the inner MPC complex number.
The returned pointer will be valid for as long as self
is valid.
§Examples
use gmp_mpfr_sys::mpc;
use gmp_mpfr_sys::mpfr;
use gmp_mpfr_sys::mpfr::rnd_t;
use rug::Complex;
let c = Complex::with_val(53, (-14.5, 3.25));
let m_ptr = c.as_raw();
unsafe {
let re_ptr = mpc::realref_const(m_ptr);
let re = mpfr::get_d(re_ptr, rnd_t::RNDN);
assert_eq!(re, -14.5);
let im_ptr = mpc::imagref_const(m_ptr);
let im = mpfr::get_d(im_ptr, rnd_t::RNDN);
assert_eq!(im, 3.25);
}
// c is still valid
assert_eq!(c, (-14.5, 3.25));
sourcepub fn as_raw_mut(&mut self) -> *mut mpc_t
pub fn as_raw_mut(&mut self) -> *mut mpc_t
Returns an unsafe mutable pointer to the inner MPC complex number.
The returned pointer will be valid for as long as self
is valid.
§Examples
use gmp_mpfr_sys::mpc;
use rug::Complex;
let mut c = Complex::with_val(53, (-14.5, 3.25));
let m_ptr = c.as_raw_mut();
unsafe {
mpc::conj(m_ptr, m_ptr, mpc::RNDNN);
}
assert_eq!(c, (-14.5, -3.25));
sourcepub fn parse<S: AsRef<[u8]>>(
src: S,
) -> Result<ParseIncomplete, ParseComplexError>
pub fn parse<S: AsRef<[u8]>>( src: S, ) -> Result<ParseIncomplete, ParseComplexError>
Parses a decimal string slice (&str
) or byte slice
(&[u8]
) into a
Complex
number.
The following are implemented with the unwrapped returned
incomplete-computation value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
The string can contain either of the following three:
- One floating-point number that can be parsed by
Float::parse
. ASCII whitespace is treated in the same way as well. - Two floating-point numbers inside round brackets separated by one comma. ASCII whitespace is treated in the same way as 1 above, and is also allowed around the brackets and the comma.
- Two floating-point numbers inside round brackets separated by ASCII whitespace. Since the real and imaginary parts are separated by whitespace, they themselves cannot contain whitespace. ASCII whitespace is still allowed around the brackets and between the two parts.
§Examples
use rug::Complex;
let valid1 = Complex::parse("(12.5, -13.5)");
let c1 = Complex::with_val(53, valid1.unwrap());
assert_eq!(c1, (12.5, -13.5));
let valid2 = Complex::parse("(inf 0.0)");
let c2 = Complex::with_val(53, valid2.unwrap());
assert_eq!(c2, (f64::INFINITY, 0.0));
let invalid = Complex::parse("(1 2 3)");
assert!(invalid.is_err());
sourcepub fn parse_radix<S: AsRef<[u8]>>(
src: S,
radix: i32,
) -> Result<ParseIncomplete, ParseComplexError>
pub fn parse_radix<S: AsRef<[u8]>>( src: S, radix: i32, ) -> Result<ParseIncomplete, ParseComplexError>
Parses a string slice (&str
) or byte slice
(&[u8]
) into a
Complex
number.
The following are implemented with the unwrapped returned
incomplete-computation value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
The string can contain either of the following three:
- One floating-point number that can be parsed by
Float::parse_radix
. ASCII whitespace is treated in the same way as well. - Two floating-point numbers inside round brackets separated by one comma. ASCII whitespace is treated in the same way as 1 above, and is also allowed around the brackets and the comma.
- Two floating-point numbers inside round brackets separated by ASCII whitespace. Since the real and imaginary parts are separated by whitespace, they themselves cannot contain whitespace. ASCII whitespace is still allowed around the brackets and between the two parts.
§Panics
Panics if radix
is less than 2 or greater than 36.
§Examples
use rug::Complex;
let valid1 = Complex::parse_radix("(12, 1a)", 16);
let c1 = Complex::with_val(53, valid1.unwrap());
assert_eq!(c1, (0x12, 0x1a));
let valid2 = Complex::parse_radix("(@inf@ zz)", 36);
let c2 = Complex::with_val(53, valid2.unwrap());
assert_eq!(c2, (f64::INFINITY, 35 * 36 + 35));
let invalid = Complex::parse_radix("(1 2 3)", 10);
assert!(invalid.is_err());
sourcepub fn to_string_radix(&self, radix: i32, num_digits: Option<usize>) -> String
pub fn to_string_radix(&self, radix: i32, num_digits: Option<usize>) -> String
Returns a string representation of the value for the specified radix
rounding to the nearest.
The exponent is encoded in decimal. If the number of digits is not specified, the output string will have enough precision such that reading it again will give the exact same number.
§Panics
Panics if radix
is less than 2 or greater than 36.
§Examples
use rug::Complex;
let c1 = Complex::with_val(53, 0);
assert_eq!(c1.to_string_radix(10, None), "(0 0)");
let c2 = Complex::with_val(12, (15, 5));
assert_eq!(c2.to_string_radix(16, None), "(f.000 5.000)");
let c3 = Complex::with_val(53, (10, -4));
assert_eq!(c3.to_string_radix(10, Some(3)), "(10.0 -4.00)");
assert_eq!(c3.to_string_radix(5, Some(3)), "(20.0 -4.00)");
// 2 raised to the power of 80 in hex is 1 followed by 20 zeros
let c4 = Complex::with_val(53, (80f64.exp2(), 0.25));
assert_eq!(c4.to_string_radix(10, Some(3)), "(1.21e24 2.50e-1)");
assert_eq!(c4.to_string_radix(16, Some(3)), "(1.00@20 4.00@-1)");
sourcepub fn to_string_radix_round(
&self,
radix: i32,
num_digits: Option<usize>,
round: (Round, Round),
) -> String
pub fn to_string_radix_round( &self, radix: i32, num_digits: Option<usize>, round: (Round, Round), ) -> String
Returns a string representation of the value for the specified radix
applying the specified rounding method.
The exponent is encoded in decimal. If the number of digits is not specified, the output string will have enough precision such that reading it again will give the exact same number.
§Panics
Panics if radix
is less than 2 or greater than 36.
§Examples
use rug::float::Round;
use rug::Complex;
let c = Complex::with_val(10, 10.4);
let down = (Round::Down, Round::Down);
let nearest = (Round::Nearest, Round::Nearest);
let up = (Round::Up, Round::Up);
let nd = c.to_string_radix_round(10, None, down);
assert_eq!(nd, "(10.406 0)");
let nu = c.to_string_radix_round(10, None, up);
assert_eq!(nu, "(10.407 0)");
let sd = c.to_string_radix_round(10, Some(2), down);
assert_eq!(sd, "(10 0)");
let sn = c.to_string_radix_round(10, Some(2), nearest);
assert_eq!(sn, "(10 0)");
let su = c.to_string_radix_round(10, Some(2), up);
assert_eq!(su, "(11 0)");
sourcepub fn mut_real(&mut self) -> &mut Float
pub fn mut_real(&mut self) -> &mut Float
Borrows the real part mutably.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (12.5, -20.75));
assert_eq!(c, (12.5, -20.75));
*c.mut_real() /= 2;
assert_eq!(c, (6.25, -20.75));
sourcepub fn mut_imag(&mut self) -> &mut Float
pub fn mut_imag(&mut self) -> &mut Float
Borrows the imaginary part mutably.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (12.5, -20.75));
assert_eq!(c, (12.5, -20.75));
*c.mut_imag() *= 4;
assert_eq!(c, (12.5, -83));
sourcepub fn as_mut_real_imag(&mut self) -> (&mut Float, &mut Float)
pub fn as_mut_real_imag(&mut self) -> (&mut Float, &mut Float)
Borrows the real and imaginary parts mutably.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (12.5, -20.75));
{
let (real, imag) = c.as_mut_real_imag();
*real /= 2;
*imag *= 4;
// borrow ends here
}
assert_eq!(c, (6.25, -83));
sourcepub const fn into_real_imag(self) -> (Float, Float)
pub const fn into_real_imag(self) -> (Float, Float)
Consumes and converts the value into real and imaginary Float
values.
This function reuses the allocated memory and does not allocate any new memory.
use rug::Complex;
let c = Complex::with_val(53, (12.5, -20.75));
let (real, imag) = c.into_real_imag();
assert_eq!(real, 12.5);
assert_eq!(imag, -20.75);
sourcepub const fn borrow_real_imag<'a>(
real: &'a Float,
imag: &'a Float,
) -> BorrowComplex<'a>
pub const fn borrow_real_imag<'a>( real: &'a Float, imag: &'a Float, ) -> BorrowComplex<'a>
Borrows a pair of Float
references as a Complex
number.
The returned object implements
Deref<Target = Complex>
.
For a similar method that processes two mutable Float
references as
a mutable Complex
number, see
mutate_real_imag
.
§Examples
use rug::{Complex, Float};
let real = Float::with_val(53, 4.2);
let imag = Float::with_val(53, -2.3);
let c = Complex::borrow_real_imag(&real, &imag);
assert_eq!(*c, (4.2, -2.3));
sourcepub fn mutate_real_imag<F>(real: &mut Float, imag: &mut Float, func: F)
pub fn mutate_real_imag<F>(real: &mut Float, imag: &mut Float, func: F)
Calls a function with a pair of Float
mutable references borrowed as
a Complex
number.
§Examples
use rug::{Complex, Float};
let mut real = Float::with_val(53, 4.2);
let mut imag = Float::with_val(53, -2.3);
// (4.2, -2.3) × i = (2.3, 4.2)
Complex::mutate_real_imag(&mut real, &mut imag, |c| c.mul_i_mut(false));
assert_eq!(real, 2.3);
assert_eq!(imag, 4.2);
sourcepub const fn as_neg(&self) -> BorrowComplex<'_>
pub const fn as_neg(&self) -> BorrowComplex<'_>
Borrows a negated copy of the Complex
number.
The returned object implements Deref<Target = Complex>
.
This method performs a shallow copy and negates it, and negation does not change the allocated data.
Unlike the other negation methods (the -
operator,
Neg::neg
, etc.), this method does not set the
MPFR NaN flag if a NaN is encountered.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (4.2, -2.3));
let neg_c = c.as_neg();
assert_eq!(*neg_c, (-4.2, 2.3));
// methods taking &self can be used on the returned object
let reneg_c = neg_c.as_neg();
assert_eq!(*reneg_c, (4.2, -2.3));
assert_eq!(*reneg_c, c);
sourcepub const fn as_conj(&self) -> BorrowComplex<'_>
pub const fn as_conj(&self) -> BorrowComplex<'_>
Borrows a conjugate copy of the Complex
number.
The returned object implements Deref<Target = Complex>
.
This method performs a shallow copy and negates its imaginary part, and negation does not change the allocated data.
Unlike the other conjugate methods (conj
, conj_mut
, etc.), this
method does not set the MPFR NaN flag if a NaN is encountered.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (4.2, -2.3));
let conj_c = c.as_conj();
assert_eq!(*conj_c, (4.2, 2.3));
// methods taking &self can be used on the returned object
let reconj_c = conj_c.as_conj();
assert_eq!(*reconj_c, (4.2, -2.3));
assert_eq!(*reconj_c, c);
sourcepub const fn as_mul_i(&self, negative: bool) -> BorrowComplex<'_>
pub const fn as_mul_i(&self, negative: bool) -> BorrowComplex<'_>
Borrows a rotated copy of the Complex
number.
The returned object implements Deref<Target = Complex>
.
This method operates by performing some shallow copying; unlike other
similar methods ( mul_i
, mul_i_mut
, etc.), this method swaps the
precision of the real and imaginary parts if they have unequal
precisions.
Also, unlike other similar methods (mul_i
, mul_i_mut
, etc.),
this method does not set the MPFR NaN flag if a NaN is encountered.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (4.2, -2.3));
let mul_i_c = c.as_mul_i(false);
assert_eq!(*mul_i_c, (2.3, 4.2));
// methods taking &self can be used on the returned object
let mul_ii_c = mul_i_c.as_mul_i(false);
assert_eq!(*mul_ii_c, (-4.2, 2.3));
let mul_1_c = mul_i_c.as_mul_i(true);
assert_eq!(*mul_1_c, (4.2, -2.3));
assert_eq!(*mul_1_c, c);
sourcepub const fn as_ord(&self) -> &OrdComplex
pub const fn as_ord(&self) -> &OrdComplex
Borrows the Complex
number as an ordered complex number of type
OrdComplex
.
The same result can be obtained using the implementation of
AsRef<OrdComplex>
which is provided for Complex
.
§Examples
use core::cmp::Ordering;
use rug::float::Special;
use rug::Complex;
let nan_c = Complex::with_val(53, (Special::Nan, Special::Nan));
let nan = nan_c.as_ord();
assert_eq!(nan.cmp(nan), Ordering::Equal);
let one_neg0_c = Complex::with_val(53, (1, Special::NegZero));
let one_neg0 = one_neg0_c.as_ord();
let one_pos0_c = Complex::with_val(53, (1, Special::Zero));
let one_pos0 = one_pos0_c.as_ord();
assert_eq!(one_neg0.cmp(one_pos0), Ordering::Less);
let zero_inf_s = (Special::Zero, Special::Infinity);
let zero_inf_c = Complex::with_val(53, zero_inf_s);
let zero_inf = zero_inf_c.as_ord();
assert_eq!(one_pos0.cmp(zero_inf), Ordering::Greater);
sourcepub const fn is_zero(&self) -> bool
pub const fn is_zero(&self) -> bool
Returns true
if both the real and imaginary parts are plus or minus
zero.
§Examples
use rug::float::Special;
use rug::{Assign, Complex};
let mut c = Complex::with_val(53, (Special::NegZero, Special::Zero));
assert!(c.is_zero());
c += 5.2;
assert!(!c.is_zero());
c.mut_real().assign(Special::Nan);
assert!(!c.is_zero());
sourcepub fn cmp_abs(&self, other: &Self) -> Option<Ordering>
pub fn cmp_abs(&self, other: &Self) -> Option<Ordering>
Compares the absolute values of self
and other
.
§Examples
use core::cmp::Ordering;
use rug::Complex;
let five = Complex::with_val(53, (5, 0));
let five_rotated = Complex::with_val(53, (3, -4));
let greater_than_five = Complex::with_val(53, (-4, -4));
let has_nan = Complex::with_val(53, (5, 0.0 / 0.0));
assert_eq!(five.cmp_abs(&five_rotated), Some(Ordering::Equal));
assert_eq!(five.cmp_abs(&greater_than_five), Some(Ordering::Less));
assert_eq!(five.cmp_abs(&has_nan), None);
sourcepub fn total_cmp(&self, other: &Complex) -> Ordering
pub fn total_cmp(&self, other: &Complex) -> Ordering
Returns the total ordering between self
and other
.
For ordering, the real part has precedence over the imaginary part. Negative zero is ordered as less than positive zero. Negative NaN is ordered as less than negative infinity, while positive NaN is ordered as greater than positive infinity. Comparing two negative NaNs or two positive NaNs produces equality.
§Examples
use rug::float::Special;
use rug::Complex;
let mut values = vec![
Complex::with_val(53, (Special::Zero, Special::Zero)),
Complex::with_val(53, (Special::Zero, Special::NegZero)),
Complex::with_val(53, (Special::NegZero, Special::Infinity)),
];
values.sort_by(Complex::total_cmp);
// (-0, +∞)
assert!(values[0].real().is_zero() && values[0].real().is_sign_negative());
assert!(values[0].imag().is_infinite() && values[0].imag().is_sign_positive());
// (+0, -0)
assert!(values[1].real().is_zero() && values[1].real().is_sign_positive());
assert!(values[1].imag().is_zero() && values[1].imag().is_sign_negative());
// (+0, +0)
assert!(values[2].real().is_zero() && values[2].real().is_sign_positive());
assert!(values[2].imag().is_zero() && values[2].imag().is_sign_positive());
sourcepub fn sum<'a, I>(values: I) -> SumIncomplete<'a, I>where
I: Iterator<Item = &'a Self>,
pub fn sum<'a, I>(values: I) -> SumIncomplete<'a, I>where
I: Iterator<Item = &'a Self>,
Adds a list of Complex
numbers with correct rounding.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
AddAssign<Src> for Complex
AddAssignRound<Src> for Complex
Add<Src> for Complex
,Add<Complex> for Src
SubAssign<Src> for Complex
,SubFrom<Src> for Complex
SubAssignRound<Src> for Complex
,SubFromRound<Src> for Complex
Sub<Src> for Complex
,Sub<Complex> for Src
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
// Give each value only 4 bits of precision for example purposes.
let values = [
Complex::with_val(4, (5.0, 1024.0)),
Complex::with_val(4, (1024.0, 15.0)),
Complex::with_val(4, (-1024.0, -1024.0)),
Complex::with_val(4, (-4.5, -16.0)),
];
// The result should still be exact if it fits.
let r1 = Complex::sum(values.iter());
let sum1 = Complex::with_val(4, r1);
assert_eq!(sum1, (0.5, -1.0));
let r2 = Complex::sum(values.iter());
let sum2 = Complex::with_val(4, (1.0, -1.0)) + r2;
assert_eq!(sum2, (1.5, -2.0));
let r3 = Complex::sum(values.iter());
let mut sum3 = Complex::with_val(4, (16, 16));
sum3 += r3;
// (16.5, 15) rounded to (16, 15)
assert_eq!(sum3, (16, 15));
sourcepub fn dot<'a, I>(values: I) -> DotIncomplete<'a, I>where
I: Iterator<Item = (&'a Self, &'a Self)>,
pub fn dot<'a, I>(values: I) -> DotIncomplete<'a, I>where
I: Iterator<Item = (&'a Self, &'a Self)>,
Finds the dot product of a list of Complex
numbers pairs with
correct rounding.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
AddAssign<Src> for Complex
AddAssignRound<Src> for Complex
Add<Src> for Complex
,Add<Complex> for Src
SubAssign<Src> for Complex
,SubFrom<Src> for Complex
SubAssignRound<Src> for Complex
,SubFromRound<Src> for Complex
Sub<Src> for Complex
,Sub<Complex> for Src
CompleteRound<Completed = Complex> for Src
This method will produce a result with correct rounding, except for some cases where underflow and/or overflow occur in intermediate products.
§Examples
use rug::Complex;
let a = [
Complex::with_val(53, (5.0, 10.25)),
Complex::with_val(53, (10.25, 5.0)),
];
let b = [
Complex::with_val(53, (-2.75, -11.5)),
Complex::with_val(53, (-4.5, 16.0)),
];
let r = Complex::dot(a.iter().zip(b.iter()));
let dot = Complex::with_val(53, r);
let expected = Complex::with_val(53, &a[0] * &b[0]) + &a[1] * &b[1];
assert_eq!(dot, expected);
let r = Complex::dot(a.iter().zip(b.iter()));
let add_dot = Complex::with_val(53, (1.0, 2.0)) + r;
let add_expected = Complex::with_val(53, (1.0, 2.0)) + &expected;
assert_eq!(add_dot, add_expected);
let r = Complex::dot(a.iter().zip(b.iter()));
let mut add_dot2 = Complex::with_val(53, (1.0, 2.0));
add_dot2 += r;
assert_eq!(add_dot2, add_expected);
sourcepub fn mul_add(self, mul: &Self, add: &Self) -> Self
pub fn mul_add(self, mul: &Self, add: &Self) -> Self
Multiplies and adds in one fused operation, rounding to the nearest with only one rounding error.
a.mul_add(&b, &c)
produces a result like &a * &b + &c
, but a
is
consumed and the result produced uses its precision.
§Examples
use rug::Complex;
let a = Complex::with_val(53, (10, 0));
let b = Complex::with_val(53, (1, -1));
let c = Complex::with_val(53, (1000, 1000));
// (10 + 0i) × (1 - i) + (1000 + 1000i) = (1010 + 990i)
let mul_add = a.mul_add(&b, &c);
assert_eq!(mul_add, (1010, 990));
sourcepub fn mul_add_mut(&mut self, mul: &Self, add: &Self)
pub fn mul_add_mut(&mut self, mul: &Self, add: &Self)
Multiplies and adds in one fused operation, rounding to the nearest with only one rounding error.
a.mul_add_mut(&b, &c)
produces a result like &a * &b + &c
, but
stores the result in a
using its precision.
§Examples
use rug::Complex;
let mut a = Complex::with_val(53, (10, 0));
let b = Complex::with_val(53, (1, -1));
let c = Complex::with_val(53, (1000, 1000));
// (10 + 0i) × (1 - i) + (1000 + 1000i) = (1010 + 990i)
a.mul_add_mut(&b, &c);
assert_eq!(a, (1010, 990));
sourcepub fn mul_add_round(
&mut self,
mul: &Self,
add: &Self,
round: (Round, Round),
) -> (Ordering, Ordering)
pub fn mul_add_round( &mut self, mul: &Self, add: &Self, round: (Round, Round), ) -> (Ordering, Ordering)
Multiplies and adds in one fused operation, applying the specified rounding method with only one rounding error.
a.mul_add_round(&b, &c, round)
produces a result like
ans.assign_round(&a * &b + &c, round)
, but stores the result in a
using its precision rather than in another Complex
number like
ans
.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let mut a = Complex::with_val(53, (10, 0));
let b = Complex::with_val(53, (1, -1));
let c = Complex::with_val(53, (1000, 1000));
// (10 + 0i) × (1 - i) + (1000 + 1000i) = (1010 + 990i)
let dir = a.mul_add_round(&b, &c, (Round::Nearest, Round::Nearest));
assert_eq!(a, (1010, 990));
assert_eq!(dir, (Ordering::Equal, Ordering::Equal));
sourcepub fn mul_add_ref<'a>(
&'a self,
mul: &'a Self,
add: &'a Self,
) -> AddMulIncomplete<'a>
pub fn mul_add_ref<'a>( &'a self, mul: &'a Self, add: &'a Self, ) -> AddMulIncomplete<'a>
Multiplies and adds in one fused operation.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
a.mul_add_ref(&b, &c)
produces the exact same result as
&a * &b + &c
.
§Examples
use rug::Complex;
let a = Complex::with_val(53, (10, 0));
let b = Complex::with_val(53, (1, -1));
let c = Complex::with_val(53, (1000, 1000));
// (10 + 0i) × (1 - i) + (1000 + 1000i) = (1010 + 990i)
let ans = Complex::with_val(53, a.mul_add_ref(&b, &c));
assert_eq!(ans, (1010, 990));
sourcepub fn mul_sub(self, mul: &Self, sub: &Self) -> Self
pub fn mul_sub(self, mul: &Self, sub: &Self) -> Self
Multiplies and subtracts in one fused operation, rounding to the nearest with only one rounding error.
a.mul_sub(&b, &c)
produces a result like &a * &b - &c
, but a
is
consumed and the result produced uses its precision.
§Examples
use rug::Complex;
let a = Complex::with_val(53, (10, 0));
let b = Complex::with_val(53, (1, -1));
let c = Complex::with_val(53, (1000, 1000));
// (10 + 0i) × (1 - i) - (1000 + 1000i) = (-990 - 1010i)
let mul_sub = a.mul_sub(&b, &c);
assert_eq!(mul_sub, (-990, -1010));
sourcepub fn mul_sub_mut(&mut self, mul: &Self, sub: &Self)
pub fn mul_sub_mut(&mut self, mul: &Self, sub: &Self)
Multiplies and subtracts in one fused operation, rounding to the nearest with only one rounding error.
a.mul_sub_mut(&b, &c)
produces a result like &a * &b - &c
, but
stores the result in a
using its precision.
§Examples
use rug::Complex;
let mut a = Complex::with_val(53, (10, 0));
let b = Complex::with_val(53, (1, -1));
let c = Complex::with_val(53, (1000, 1000));
// (10 + 0i) × (1 - i) - (1000 + 1000i) = (-990 - 1010i)
a.mul_sub_mut(&b, &c);
assert_eq!(a, (-990, -1010));
sourcepub fn mul_sub_round(
&mut self,
mul: &Self,
sub: &Self,
round: (Round, Round),
) -> (Ordering, Ordering)
pub fn mul_sub_round( &mut self, mul: &Self, sub: &Self, round: (Round, Round), ) -> (Ordering, Ordering)
Multiplies and subtracts in one fused operation, applying the specified rounding method with only one rounding error.
a.mul_sub_round(&b, &c, round)
produces a result like
ans.assign_round(&a * &b - &c, round)
, but stores the result in a
using its precision rather than in another Complex
number like
ans
.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let mut a = Complex::with_val(53, (10, 0));
let b = Complex::with_val(53, (1, -1));
let c = Complex::with_val(53, (1000, 1000));
// (10 + 0i) × (1 - i) - (1000 + 1000i) = (-990 - 1010i)
let dir = a.mul_sub_round(&b, &c, (Round::Nearest, Round::Nearest));
assert_eq!(a, (-990, -1010));
assert_eq!(dir, (Ordering::Equal, Ordering::Equal));
sourcepub fn mul_sub_ref<'a>(
&'a self,
mul: &'a Self,
sub: &'a Self,
) -> SubMulFromIncomplete<'a>
pub fn mul_sub_ref<'a>( &'a self, mul: &'a Self, sub: &'a Self, ) -> SubMulFromIncomplete<'a>
Multiplies and subtracts in one fused operation.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
a.mul_sub_ref(&b, &c)
produces the exact same result as &a * &b - &c
.
§Examples
use rug::Complex;
let a = Complex::with_val(53, (10, 0));
let b = Complex::with_val(53, (1, -1));
let c = Complex::with_val(53, (1000, 1000));
// (10 + 0i) × (1 - i) - (1000 + 1000i) = (-990 - 1010i)
let ans = Complex::with_val(53, a.mul_sub_ref(&b, &c));
assert_eq!(ans, (-990, -1010));
sourcepub fn proj(self) -> Self
pub fn proj(self) -> Self
Computes a projection onto the Riemann sphere, rounding to the nearest.
If no parts of the number are infinite, the result is unchanged. If any part is infinite, the real part of the result is set to +∞ and the imaginary part of the result is set to 0 with the same sign as the imaginary part of the input.
§Examples
use rug::Complex;
let c1 = Complex::with_val(53, (1.5, 2.5));
let proj1 = c1.proj();
assert_eq!(proj1, (1.5, 2.5));
let c2 = Complex::with_val(53, (f64::NAN, f64::NEG_INFINITY));
let proj2 = c2.proj();
assert_eq!(proj2, (f64::INFINITY, 0.0));
// imaginary was negative, so now it is minus zero
assert!(proj2.imag().is_sign_negative());
sourcepub fn proj_mut(&mut self)
pub fn proj_mut(&mut self)
Computes a projection onto the Riemann sphere, rounding to the nearest.
If no parts of the number are infinite, the result is unchanged. If any part is infinite, the real part of the result is set to +∞ and the imaginary part of the result is set to 0 with the same sign as the imaginary part of the input.
§Examples
use rug::Complex;
let mut c1 = Complex::with_val(53, (1.5, 2.5));
c1.proj_mut();
assert_eq!(c1, (1.5, 2.5));
let mut c2 = Complex::with_val(53, (f64::NAN, f64::NEG_INFINITY));
c2.proj_mut();
assert_eq!(c2, (f64::INFINITY, 0.0));
// imaginary was negative, so now it is minus zero
assert!(c2.imag().is_sign_negative());
sourcepub fn proj_ref(&self) -> ProjIncomplete<'_>
pub fn proj_ref(&self) -> ProjIncomplete<'_>
Computes the projection onto the Riemann sphere.
If no parts of the number are infinite, the result is unchanged. If any part is infinite, the real part of the result is set to +∞ and the imaginary part of the result is set to 0 with the same sign as the imaginary part of the input.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c1 = Complex::with_val(53, (f64::INFINITY, 50));
let proj1 = Complex::with_val(53, c1.proj_ref());
assert_eq!(proj1, (f64::INFINITY, 0.0));
let c2 = Complex::with_val(53, (f64::NAN, f64::NEG_INFINITY));
let proj2 = Complex::with_val(53, c2.proj_ref());
assert_eq!(proj2, (f64::INFINITY, 0.0));
// imaginary was negative, so now it is minus zero
assert!(proj2.imag().is_sign_negative());
sourcepub fn square(self) -> Self
pub fn square(self) -> Self
Computes the square, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, -2));
// (1 - 2i) squared is (-3 - 4i)
let square = c.square();
assert_eq!(square, (-3, -4));
sourcepub fn square_mut(&mut self)
pub fn square_mut(&mut self)
Computes the square, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, -2));
// (1 - 2i) squared is (-3 - 4i)
c.square_mut();
assert_eq!(c, (-3, -4));
sourcepub fn square_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn square_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the square, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let mut c = Complex::with_val(4, (1.25, 1.25));
// (1.25 + 1.25i) squared is (0 + 3.125i).
// With 4 bits of precision, 3.125 is rounded down to 3.
let dir = c.square_round((Round::Down, Round::Down));
assert_eq!(c, (0, 3));
assert_eq!(dir, (Ordering::Equal, Ordering::Less));
sourcepub fn square_ref(&self) -> SquareIncomplete<'_>
pub fn square_ref(&self) -> SquareIncomplete<'_>
Computes the square.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let c = Complex::with_val(53, (1.25, 1.25));
// (1.25 + 1.25i) squared is (0 + 3.125i).
let r = c.square_ref();
// With 4 bits of precision, 3.125 is rounded down to 3.
let round = (Round::Down, Round::Down);
let (square, dir) = Complex::with_val_round(4, r, round);
assert_eq!(square, (0, 3));
assert_eq!(dir, (Ordering::Equal, Ordering::Less));
sourcepub fn sqrt(self) -> Self
pub fn sqrt(self) -> Self
Computes the square root, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (-1, 0));
// square root of (-1 + 0i) is (0 + i)
let sqrt = c.sqrt();
assert_eq!(sqrt, (0, 1));
sourcepub fn sqrt_mut(&mut self)
pub fn sqrt_mut(&mut self)
Computes the square root, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (-1, 0));
// square root of (-1 + 0i) is (0 + i)
c.sqrt_mut();
assert_eq!(c, (0, 1));
sourcepub fn sqrt_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn sqrt_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the square root, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let mut c = Complex::with_val(4, (2, 2.25));
// Square root of (2 + 2.25i) is (1.5828 + 0.7108i).
// Nearest with 4 bits of precision: (1.625 + 0.6875i)
let dir = c.sqrt_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (1.625, 0.6875));
assert_eq!(dir, (Ordering::Greater, Ordering::Less));
sourcepub fn sqrt_ref(&self) -> SqrtIncomplete<'_>
pub fn sqrt_ref(&self) -> SqrtIncomplete<'_>
Computes the square root.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let c = Complex::with_val(53, (2, 2.25));
// Square root of (2 + 2.25i) is (1.5828 + 0.7108i).
let r = c.sqrt_ref();
// Nearest with 4 bits of precision: (1.625 + 0.6875i)
let nearest = (Round::Nearest, Round::Nearest);
let (sqrt, dir) = Complex::with_val_round(4, r, nearest);
assert_eq!(sqrt, (1.625, 0.6875));
assert_eq!(dir, (Ordering::Greater, Ordering::Less));
sourcepub fn conj(self) -> Self
pub fn conj(self) -> Self
Computes the complex conjugate.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1.5, 2.5));
let conj = c.conj();
assert_eq!(conj, (1.5, -2.5));
sourcepub fn conj_mut(&mut self)
pub fn conj_mut(&mut self)
Computes the complex conjugate.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1.5, 2.5));
c.conj_mut();
assert_eq!(c, (1.5, -2.5));
sourcepub fn conj_ref(&self) -> ConjIncomplete<'_>
pub fn conj_ref(&self) -> ConjIncomplete<'_>
Computes the complex conjugate.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1.5, 2.5));
let conj = Complex::with_val(53, c.conj_ref());
assert_eq!(conj, (1.5, -2.5));
sourcepub fn abs(self) -> Self
pub fn abs(self) -> Self
Computes the absolute value, rounding to the nearest.
The real part is set to the absolute value and the imaginary part is set to zero.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (30, 40));
let abs = c.abs();
assert_eq!(abs, 50);
sourcepub fn abs_mut(&mut self)
pub fn abs_mut(&mut self)
Computes the absolute value, rounding to the nearest.
The real part is set to the absolute value and the imaginary part is set to zero.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (30, 40));
c.abs_mut();
assert_eq!(c, (50, 0));
sourcepub fn abs_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn abs_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the absolute value, applying the specified rounding method.
The real part is set to the absolute value and the imaginary part is set to zero.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (30, 40));
// 50 rounded up using 4 bits is 52
let dir = c.abs_round((Round::Up, Round::Up));
assert_eq!(c, (52, 0));
assert_eq!(dir, (Ordering::Greater, Ordering::Equal));
sourcepub fn abs_ref(&self) -> AbsIncomplete<'_>
pub fn abs_ref(&self) -> AbsIncomplete<'_>
Computes the absolute value.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Float
Assign<Src> for Complex
AssignRound<Src> for Float
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::{Complex, Float};
let c = Complex::with_val(53, (30, 40));
let f = Float::with_val(53, c.abs_ref());
assert_eq!(f, 50);
sourcepub fn arg(self) -> Self
pub fn arg(self) -> Self
Computes the argument, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (4, 3));
let f = c.arg();
assert_eq!(f, 0.75_f64.atan());
Special values are handled like atan2 in IEEE 754-2008.
use rug::Complex;
let c = Complex::with_val(53, (40, 30));
let arg = c.arg();
assert_eq!(arg, (0.75_f64.atan(), 0));
sourcepub fn arg_mut(&mut self)
pub fn arg_mut(&mut self)
Computes the argument, rounding to the nearest.
The real part is set to the argument and the imaginary part is set to zero.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (40, 30));
c.arg_mut();
assert_eq!(c, (0.75_f64.atan(), 0));
sourcepub fn arg_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn arg_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the argument, applying the specified rounding method.
The real part is set to the argument and the imaginary part is set to zero.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// use only 4 bits of precision
let mut c = Complex::with_val(4, (3, 4));
// arg(3 + 4i) = 0.9316.
// 0.9316 rounded to the nearest is 0.9375.
let dir = c.arg_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (0.9375, 0));
assert_eq!(dir, (Ordering::Greater, Ordering::Equal));
sourcepub fn arg_ref(&self) -> ArgIncomplete<'_>
pub fn arg_ref(&self) -> ArgIncomplete<'_>
Computes the argument.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Float
Assign<Src> for Complex
AssignRound<Src> for Float
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use core::f64;
use rug::{Assign, Complex, Float};
// f has precision 53, just like f64, so PI constants match.
let mut arg = Float::new(53);
let c_pos = Complex::with_val(53, 1);
arg.assign(c_pos.arg_ref());
assert!(arg.is_zero());
let c_neg = Complex::with_val(53, -1.3);
arg.assign(c_neg.arg_ref());
assert_eq!(arg, f64::consts::PI);
let c_pi_4 = Complex::with_val(53, (1.333, 1.333));
arg.assign(c_pi_4.arg_ref());
assert_eq!(arg, f64::consts::FRAC_PI_4);
sourcepub fn mul_i(self, negative: bool) -> Self
pub fn mul_i(self, negative: bool) -> Self
Multiplies the complex number by ±i, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (13, 24));
let rot1 = c.mul_i(false);
assert_eq!(rot1, (-24, 13));
let rot2 = rot1.mul_i(false);
assert_eq!(rot2, (-13, -24));
let rot2_less1 = rot2.mul_i(true);
assert_eq!(rot2_less1, (-24, 13));
sourcepub fn mul_i_mut(&mut self, negative: bool)
pub fn mul_i_mut(&mut self, negative: bool)
Multiplies the complex number by ±i, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (13, 24));
c.mul_i_mut(false);
assert_eq!(c, (-24, 13));
c.mul_i_mut(false);
assert_eq!(c, (-13, -24));
c.mul_i_mut(true);
assert_eq!(c, (-24, 13));
sourcepub fn mul_i_round(
&mut self,
negative: bool,
round: (Round, Round),
) -> (Ordering, Ordering)
pub fn mul_i_round( &mut self, negative: bool, round: (Round, Round), ) -> (Ordering, Ordering)
Multiplies the complex number by ±i, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// only 4 bits of precision for imaginary part
let mut c = Complex::with_val((53, 4), (127, 15));
assert_eq!(c, (127, 15));
let dir = c.mul_i_round(false, (Round::Down, Round::Down));
assert_eq!(c, (-15, 120));
assert_eq!(dir, (Ordering::Equal, Ordering::Less));
let dir = c.mul_i_round(true, (Round::Down, Round::Down));
assert_eq!(c, (120, 15));
assert_eq!(dir, (Ordering::Equal, Ordering::Equal));
sourcepub fn mul_i_ref(&self, negative: bool) -> MulIIncomplete<'_>
pub fn mul_i_ref(&self, negative: bool) -> MulIIncomplete<'_>
Multiplies the complex number by ±i.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (13, 24));
let rotated = Complex::with_val(53, c.mul_i_ref(false));
assert_eq!(rotated, (-24, 13));
sourcepub fn recip(self) -> Self
pub fn recip(self) -> Self
Computes the reciprocal, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
// 1/(1 + i) = (0.5 - 0.5i)
let recip = c.recip();
assert_eq!(recip, (0.5, -0.5));
sourcepub fn recip_mut(&mut self)
pub fn recip_mut(&mut self)
Computes the reciprocal, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
// 1/(1 + i) = (0.5 - 0.5i)
c.recip_mut();
assert_eq!(c, (0.5, -0.5));
sourcepub fn recip_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn recip_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the reciprocal, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
let mut c = Complex::with_val(4, (1, 2));
// 1/(1 + 2i) = (0.2 - 0.4i), binary (0.00110011..., -0.01100110...)
// 4 bits of precision: (0.001101, -0.01101) = (13/64, -13/32)
let dir = c.recip_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (13.0/64.0, -13.0/32.0));
assert_eq!(dir, (Ordering::Greater, Ordering::Less));
sourcepub fn recip_ref(&self) -> RecipIncomplete<'_>
pub fn recip_ref(&self) -> RecipIncomplete<'_>
Computes the reciprocal.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
// 1/(1 + i) = (0.5 - 0.5i)
let recip = Complex::with_val(53, c.recip_ref());
assert_eq!(recip, (0.5, -0.5));
sourcepub fn norm(self) -> Self
pub fn norm(self) -> Self
Computes the norm, that is the square of the absolute value, rounding it to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (3, 4));
let norm = c.norm();
assert_eq!(norm, 25);
sourcepub fn norm_mut(&mut self)
pub fn norm_mut(&mut self)
Computes the norm, that is the square of the absolute value, rounding to the nearest.
The real part is set to the norm and the imaginary part is set to zero.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (3, 4));
c.norm_mut();
assert_eq!(c, (25, 0));
sourcepub fn norm_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn norm_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the norm, that is the square of the absolute value, applying the specified rounding method.
The real part is set to the norm and the imaginary part is set to zero.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// use only 4 bits of precision
let mut c = Complex::with_val(4, (3, 4));
// 25 rounded up using 4 bits is 26
let dir = c.norm_round((Round::Up, Round::Up));
assert_eq!(c, (26, 0));
assert_eq!(dir, (Ordering::Greater, Ordering::Equal));
sourcepub fn norm_ref(&self) -> NormIncomplete<'_>
pub fn norm_ref(&self) -> NormIncomplete<'_>
Computes the norm, that is the square of the absolute value.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Float
Assign<Src> for Complex
AssignRound<Src> for Float
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::{Complex, Float};
let c = Complex::with_val(53, (3, 4));
let f = Float::with_val(53, c.norm_ref());
assert_eq!(f, 25);
sourcepub fn ln(self) -> Self
pub fn ln(self) -> Self
Computes the natural logarithm, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1.5, -0.5));
let ln = c.ln();
let expected = Complex::with_val(53, (0.4581, -0.3218));
assert!(*(ln - expected).abs().real() < 0.0001);
sourcepub fn ln_mut(&mut self)
pub fn ln_mut(&mut self)
Computes the natural logarithm, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1.5, -0.5));
c.ln_mut();
let expected = Complex::with_val(53, (0.4581, -0.3218));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn ln_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn ln_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the natural logarithm, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1.5, -0.5));
// ln(1.5 - 0.5i) = (0.4581 - 0.3218i)
// using 4 significant bits: (0.46875 - 0.3125i)
let dir = c.ln_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (0.46875, -0.3125));
assert_eq!(dir, (Ordering::Greater, Ordering::Greater));
sourcepub fn ln_ref(&self) -> LnIncomplete<'_>
pub fn ln_ref(&self) -> LnIncomplete<'_>
Computes the natural logarithm.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1.5, -0.5));
let ln = Complex::with_val(53, c.ln_ref());
let expected = Complex::with_val(53, (0.4581, -0.3218));
assert!(*(ln - expected).abs().real() < 0.0001);
sourcepub fn log10(self) -> Self
pub fn log10(self) -> Self
Computes the logarithm to base 10, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1.5, -0.5));
let log10 = c.log10();
let expected = Complex::with_val(53, (0.1990, -0.1397));
assert!(*(log10 - expected).abs().real() < 0.0001);
sourcepub fn log10_mut(&mut self)
pub fn log10_mut(&mut self)
Computes the logarithm to base 10, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1.5, -0.5));
c.log10_mut();
let expected = Complex::with_val(53, (0.1990, -0.1397));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn log10_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn log10_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the logarithm to base 10, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1.5, -0.5));
// log10(1.5 - 0.5i) = (0.1990 - 0.1397i)
// using 4 significant bits: (0.203125 - 0.140625i)
let dir = c.log10_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (0.203125, -0.140625));
assert_eq!(dir, (Ordering::Greater, Ordering::Less));
sourcepub fn log10_ref(&self) -> Log10Incomplete<'_>
pub fn log10_ref(&self) -> Log10Incomplete<'_>
Computes the logarithm to base 10.
The following are implemented with the returned
incomplete-computation value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1.5, -0.5));
let log10 = Complex::with_val(53, c.log10_ref());
let expected = Complex::with_val(53, (0.1990, -0.1397));
assert!(*(log10 - expected).abs().real() < 0.0001);
sourcepub fn root_of_unity(n: u32, k: u32) -> RootOfUnityIncomplete
pub fn root_of_unity(n: u32, k: u32) -> RootOfUnityIncomplete
Generates a root of unity, rounding to the nearest.
The generated number is the nth root of unity raised to the power k, that is its magnitude is 1 and its argument is 2πk/n.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let r = Complex::root_of_unity(3, 2);
let c = Complex::with_val(53, r);
let expected = Complex::with_val(53, (-0.5, -0.8660));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn exp(self) -> Self
pub fn exp(self) -> Self
Computes the exponential, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (0.5, -0.75));
let exp = c.exp();
let expected = Complex::with_val(53, (1.2064, -1.1238));
assert!(*(exp - expected).abs().real() < 0.0001);
sourcepub fn exp_mut(&mut self)
pub fn exp_mut(&mut self)
Computes the exponential, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (0.5, -0.75));
c.exp_mut();
let expected = Complex::with_val(53, (1.2064, -1.1238));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn exp_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn exp_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the exponential, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (0.5, -0.75));
// exp(0.5 - 0.75i) = (1.2064 - 1.1238i)
// using 4 significant bits: (1.25 - 1.125)
let dir = c.exp_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (1.25, -1.125));
assert_eq!(dir, (Ordering::Greater, Ordering::Less));
sourcepub fn exp_ref(&self) -> ExpIncomplete<'_>
pub fn exp_ref(&self) -> ExpIncomplete<'_>
Computes the exponential.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (0.5, -0.75));
let exp = Complex::with_val(53, c.exp_ref());
let expected = Complex::with_val(53, (1.2064, -1.1238));
assert!(*(exp - expected).abs().real() < 0.0001);
sourcepub fn sin(self) -> Self
pub fn sin(self) -> Self
Computes the sine, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let sin = c.sin();
let expected = Complex::with_val(53, (1.2985, 0.6350));
assert!(*(sin - expected).abs().real() < 0.0001);
sourcepub fn sin_mut(&mut self)
pub fn sin_mut(&mut self)
Computes the sine, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.sin_mut();
let expected = Complex::with_val(53, (1.2985, 0.6350));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn sin_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn sin_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the sine, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// sin(1 + i) = (1.2985 + 0.6350i)
// using 4 significant bits: (1.25 + 0.625i)
let dir = c.sin_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (1.25, 0.625));
assert_eq!(dir, (Ordering::Less, Ordering::Less));
sourcepub fn sin_ref(&self) -> SinIncomplete<'_>
pub fn sin_ref(&self) -> SinIncomplete<'_>
Computes the sine.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let sin = Complex::with_val(53, c.sin_ref());
let expected = Complex::with_val(53, (1.2985, 0.6350));
assert!(*(sin - expected).abs().real() < 0.0001);
sourcepub fn cos(self) -> Self
pub fn cos(self) -> Self
Computes the cosine, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let cos = c.cos();
let expected = Complex::with_val(53, (0.8337, -0.9889));
assert!(*(cos - expected).abs().real() < 0.0001);
sourcepub fn cos_mut(&mut self)
pub fn cos_mut(&mut self)
Computes the cosine, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.cos_mut();
let expected = Complex::with_val(53, (0.8337, -0.9889));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn cos_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn cos_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the cosine, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// cos(1 + i) = (0.8337 - 0.9889i)
// using 4 significant bits: (0.8125 - i)
let dir = c.cos_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (0.8125, -1));
assert_eq!(dir, (Ordering::Less, Ordering::Less));
sourcepub fn cos_ref(&self) -> CosIncomplete<'_>
pub fn cos_ref(&self) -> CosIncomplete<'_>
Computes the cosine.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let cos = Complex::with_val(53, c.cos_ref());
let expected = Complex::with_val(53, (0.8337, -0.9889));
assert!(*(cos - expected).abs().real() < 0.0001);
sourcepub fn sin_cos(self, cos: Self) -> (Self, Self)
pub fn sin_cos(self, cos: Self) -> (Self, Self)
Computes the sine and cosine of self
, rounding to the nearest.
The sine keeps the precision of self
while the cosine keeps the
precision of cos
.
The initial value of cos
is ignored.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let (sin, cos) = c.sin_cos(Complex::new(53));
let expected_sin = Complex::with_val(53, (1.2985, 0.6350));
let expected_cos = Complex::with_val(53, (0.8337, -0.9889));
assert!(*(sin - expected_sin).abs().real() < 0.0001);
assert!(*(cos - expected_cos).abs().real() < 0.0001);
sourcepub fn sin_cos_mut(&mut self, cos: &mut Self)
pub fn sin_cos_mut(&mut self, cos: &mut Self)
Computes the sine and cosine of self
, rounding to the nearest.
The sine is stored in self
and keeps its precision, while the cosine
is stored in cos
keeping its precision.
The initial value of cos
is ignored.
§Examples
use rug::Complex;
let mut sin = Complex::with_val(53, (1, 1));
let mut cos = Complex::new(53);
sin.sin_cos_mut(&mut cos);
let expected_sin = Complex::with_val(53, (1.2985, 0.6350));
let expected_cos = Complex::with_val(53, (0.8337, -0.9889));
assert!(*(sin - expected_sin).abs().real() < 0.0001);
assert!(*(cos - expected_cos).abs().real() < 0.0001);
sourcepub fn sin_cos_round(
&mut self,
cos: &mut Self,
round: (Round, Round),
) -> ((Ordering, Ordering), (Ordering, Ordering))
pub fn sin_cos_round( &mut self, cos: &mut Self, round: (Round, Round), ) -> ((Ordering, Ordering), (Ordering, Ordering))
Computes the sine and cosine of self
, applying the specified rounding
methods.
The sine is stored in self
and keeps its precision, while the cosine
is stored in cos
keeping its precision.
The initial value of cos
is ignored.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut sin = Complex::with_val(4, (1, 1));
let mut cos = Complex::new(4);
// sin(1 + i) = (1.2985 + 0.6350)
// using 4 significant bits: (1.25 + 0.625i)
// cos(1 + i) = (0.8337 - 0.9889i)
// using 4 significant bits: (0.8125 - i)
let (dir_sin, dir_cos) =
sin.sin_cos_round(&mut cos, (Round::Nearest, Round::Nearest));
assert_eq!(sin, (1.25, 0.625));
assert_eq!(dir_sin, (Ordering::Less, Ordering::Less));
assert_eq!(cos, (0.8125, -1));
assert_eq!(dir_cos, (Ordering::Less, Ordering::Less));
sourcepub fn sin_cos_ref(&self) -> SinCosIncomplete<'_>
pub fn sin_cos_ref(&self) -> SinCosIncomplete<'_>
Computes the sine and cosine.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for (Complex, Complex)
Assign<Src> for (&mut Complex, &mut Complex)
AssignRound<Src> for (Complex, Complex)
AssignRound<Src> for (&mut Complex, &mut Complex)
CompleteRound<Completed = (Complex, Complex)> for Src
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::ops::AssignRound;
use rug::{Assign, Complex};
let phase = Complex::with_val(53, (1, 1));
let (mut sin, mut cos) = (Complex::new(53), Complex::new(53));
let sin_cos = phase.sin_cos_ref();
(&mut sin, &mut cos).assign(sin_cos);
let expected_sin = Complex::with_val(53, (1.2985, 0.6350));
let expected_cos = Complex::with_val(53, (0.8337, -0.9889));
assert!(*(sin - expected_sin).abs().real() < 0.0001);
assert!(*(cos - expected_cos).abs().real() < 0.0001);
// using 4 significant bits: sin = (1.25 + 0.625i)
// using 4 significant bits: cos = (0.8125 - i)
let (mut sin_4, mut cos_4) = (Complex::new(4), Complex::new(4));
let sin_cos = phase.sin_cos_ref();
let (dir_sin, dir_cos) = (&mut sin_4, &mut cos_4)
.assign_round(sin_cos, (Round::Nearest, Round::Nearest));
assert_eq!(sin_4, (1.25, 0.625));
assert_eq!(dir_sin, (Ordering::Less, Ordering::Less));
assert_eq!(cos_4, (0.8125, -1));
assert_eq!(dir_cos, (Ordering::Less, Ordering::Less));
sourcepub fn tan(self) -> Self
pub fn tan(self) -> Self
Computes the tangent, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let tan = c.tan();
let expected = Complex::with_val(53, (0.2718, 1.0839));
assert!(*(tan - expected).abs().real() < 0.0001);
sourcepub fn tan_mut(&mut self)
pub fn tan_mut(&mut self)
Computes the tangent, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.tan_mut();
let expected = Complex::with_val(53, (0.2718, 1.0839));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn tan_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn tan_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the tangent, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// tan(1 + i) = (0.2718 + 1.0839)
// using 4 significant bits: (0.28125 + 1.125i)
let dir = c.tan_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (0.28125, 1.125));
assert_eq!(dir, (Ordering::Greater, Ordering::Greater));
sourcepub fn tan_ref(&self) -> TanIncomplete<'_>
pub fn tan_ref(&self) -> TanIncomplete<'_>
Computes the tangent.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let tan = Complex::with_val(53, c.tan_ref());
let expected = Complex::with_val(53, (0.2718, 1.0839));
assert!(*(tan - expected).abs().real() < 0.0001);
sourcepub fn sinh(self) -> Self
pub fn sinh(self) -> Self
Computes the hyperbolic sine, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let sinh = c.sinh();
let expected = Complex::with_val(53, (0.6350, 1.2985));
assert!(*(sinh - expected).abs().real() < 0.0001);
sourcepub fn sinh_mut(&mut self)
pub fn sinh_mut(&mut self)
Computes the hyperbolic sine, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.sinh_mut();
let expected = Complex::with_val(53, (0.6350, 1.2985));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn sinh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn sinh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the hyperbolic sine, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// sinh(1 + i) = (0.6350 + 1.2985i)
// using 4 significant bits: (0.625 + 1.25i)
let dir = c.sinh_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (0.625, 1.25));
assert_eq!(dir, (Ordering::Less, Ordering::Less));
sourcepub fn sinh_ref(&self) -> SinhIncomplete<'_>
pub fn sinh_ref(&self) -> SinhIncomplete<'_>
Computes the hyperbolic sine.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let sinh = Complex::with_val(53, c.sinh_ref());
let expected = Complex::with_val(53, (0.6350, 1.2985));
assert!(*(sinh - expected).abs().real() < 0.0001);
sourcepub fn cosh(self) -> Self
pub fn cosh(self) -> Self
Computes the hyperbolic cosine, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let cosh = c.cosh();
let expected = Complex::with_val(53, (0.8337, 0.9889));
assert!(*(cosh - expected).abs().real() < 0.0001);
sourcepub fn cosh_mut(&mut self)
pub fn cosh_mut(&mut self)
Computes the hyperbolic cosine, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.cosh_mut();
let expected = Complex::with_val(53, (0.8337, 0.9889));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn cosh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn cosh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the hyperbolic cosine, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// cosh(1 + i) = (0.8337 + 0.9889)
// using 4 significant bits: (0.8125 + i)
let dir = c.cosh_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (0.8125, 1));
assert_eq!(dir, (Ordering::Less, Ordering::Greater));
sourcepub fn cosh_ref(&self) -> CoshIncomplete<'_>
pub fn cosh_ref(&self) -> CoshIncomplete<'_>
Computes the hyperbolic cosine.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let cosh = Complex::with_val(53, c.cosh_ref());
let expected = Complex::with_val(53, (0.8337, 0.9889));
assert!(*(cosh - expected).abs().real() < 0.0001);
sourcepub fn tanh(self) -> Self
pub fn tanh(self) -> Self
Computes the hyperbolic tangent, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let tanh = c.tanh();
let expected = Complex::with_val(53, (1.0839, 0.2718));
assert!(*(tanh - expected).abs().real() < 0.0001);
sourcepub fn tanh_mut(&mut self)
pub fn tanh_mut(&mut self)
Computes the hyperbolic tangent, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.tanh_mut();
let expected = Complex::with_val(53, (1.0839, 0.2718));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn tanh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn tanh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the hyperbolic tangent, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// tanh(1 + i) = (1.0839 + 0.2718i)
// using 4 significant bits: (1.125 + 0.28125i)
let dir = c.tanh_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (1.125, 0.28125));
assert_eq!(dir, (Ordering::Greater, Ordering::Greater));
sourcepub fn tanh_ref(&self) -> TanhIncomplete<'_>
pub fn tanh_ref(&self) -> TanhIncomplete<'_>
Computes the hyperbolic tangent.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let tanh = Complex::with_val(53, c.tanh_ref());
let expected = Complex::with_val(53, (1.0839, 0.2718));
assert!(*(tanh - expected).abs().real() < 0.0001);
sourcepub fn asin(self) -> Self
pub fn asin(self) -> Self
Computes the inverse sine, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let asin = c.asin();
let expected = Complex::with_val(53, (0.6662, 1.0613));
assert!(*(asin - expected).abs().real() < 0.0001);
sourcepub fn asin_mut(&mut self)
pub fn asin_mut(&mut self)
Computes the inverse sine, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.asin_mut();
let expected = Complex::with_val(53, (0.6662, 1.0613));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn asin_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn asin_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the inverse sine, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// asin(1 + i) = (0.6662 + 1.0613i)
// using 4 significant bits: (0.6875 + i)
let dir = c.asin_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (0.6875, 1));
assert_eq!(dir, (Ordering::Greater, Ordering::Less));
sourcepub fn asin_ref(&self) -> AsinIncomplete<'_>
pub fn asin_ref(&self) -> AsinIncomplete<'_>
Computes the inverse sine.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let asin = Complex::with_val(53, c.asin_ref());
let expected = Complex::with_val(53, (0.6662, 1.0613));
assert!(*(asin - expected).abs().real() < 0.0001);
sourcepub fn acos(self) -> Self
pub fn acos(self) -> Self
Computes the inverse cosine, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let acos = c.acos();
let expected = Complex::with_val(53, (0.9046, -1.0613));
assert!(*(acos - expected).abs().real() < 0.0001);
sourcepub fn acos_mut(&mut self)
pub fn acos_mut(&mut self)
Computes the inverse cosine, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.acos_mut();
let expected = Complex::with_val(53, (0.9046, -1.0613));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn acos_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn acos_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the inverse cosine, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// acos(1 + i) = (0.9046 - 1.0613i)
// using 4 significant bits: (0.875 - i)
let dir = c.acos_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (0.875, -1));
assert_eq!(dir, (Ordering::Less, Ordering::Greater));
sourcepub fn acos_ref(&self) -> AcosIncomplete<'_>
pub fn acos_ref(&self) -> AcosIncomplete<'_>
Computes the inverse cosine.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let acos = Complex::with_val(53, c.acos_ref());
let expected = Complex::with_val(53, (0.9046, -1.0613));
assert!(*(acos - expected).abs().real() < 0.0001);
sourcepub fn atan(self) -> Self
pub fn atan(self) -> Self
Computes the inverse tangent, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let atan = c.atan();
let expected = Complex::with_val(53, (1.0172, 0.4024));
assert!(*(atan - expected).abs().real() < 0.0001);
sourcepub fn atan_mut(&mut self)
pub fn atan_mut(&mut self)
Computes the inverse tangent, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.atan_mut();
let expected = Complex::with_val(53, (1.0172, 0.4024));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn atan_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn atan_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the inverse tangent, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// atan(1 + i) = (1.0172 + 0.4024i)
// using 4 significant bits: (1 + 0.40625i)
let dir = c.atan_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (1, 0.40625));
assert_eq!(dir, (Ordering::Less, Ordering::Greater));
sourcepub fn atan_ref(&self) -> AtanIncomplete<'_>
pub fn atan_ref(&self) -> AtanIncomplete<'_>
Computes the inverse tangent.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let atan = Complex::with_val(53, c.atan_ref());
let expected = Complex::with_val(53, (1.0172, 0.4024));
assert!(*(atan - expected).abs().real() < 0.0001);
sourcepub fn asinh(self) -> Self
pub fn asinh(self) -> Self
Computes the inverse hyperbolic sine, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let asinh = c.asinh();
let expected = Complex::with_val(53, (1.0613, 0.6662));
assert!(*(asinh - expected).abs().real() < 0.0001);
sourcepub fn asinh_mut(&mut self)
pub fn asinh_mut(&mut self)
Computes the inverse hyperbolic sine, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.asinh_mut();
let expected = Complex::with_val(53, (1.0613, 0.6662));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn asinh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn asinh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the inverse hyperbolic sine, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// asinh(1 + i) = (1.0613 + 0.6662i)
// using 4 significant bits: (1 + 0.6875i)
let dir = c.asinh_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (1, 0.6875));
assert_eq!(dir, (Ordering::Less, Ordering::Greater));
sourcepub fn asinh_ref(&self) -> AsinhIncomplete<'_>
pub fn asinh_ref(&self) -> AsinhIncomplete<'_>
Computes the inverse hyperboic sine.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let asinh = Complex::with_val(53, c.asinh_ref());
let expected = Complex::with_val(53, (1.0613, 0.6662));
assert!(*(asinh - expected).abs().real() < 0.0001);
sourcepub fn acosh(self) -> Self
pub fn acosh(self) -> Self
Computes the inverse hyperbolic cosine, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let acosh = c.acosh();
let expected = Complex::with_val(53, (1.0613, 0.9046));
assert!(*(acosh - expected).abs().real() < 0.0001);
sourcepub fn acosh_mut(&mut self)
pub fn acosh_mut(&mut self)
Computes the inverse hyperbolic cosine, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.acosh_mut();
let expected = Complex::with_val(53, (1.0613, 0.9046));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn acosh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn acosh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the inverse hyperbolic cosine, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// acosh(1 + i) = (1.0613 + 0.9046i)
// using 4 significant bits: (1 + 0.875i)
let dir = c.acosh_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (1, 0.875));
assert_eq!(dir, (Ordering::Less, Ordering::Less));
sourcepub fn acosh_ref(&self) -> AcoshIncomplete<'_>
pub fn acosh_ref(&self) -> AcoshIncomplete<'_>
Computes the inverse hyperbolic cosine.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let acosh = Complex::with_val(53, c.acosh_ref());
let expected = Complex::with_val(53, (1.0613, 0.9046));
assert!(*(acosh - expected).abs().real() < 0.0001);
sourcepub fn atanh(self) -> Self
pub fn atanh(self) -> Self
Computes the inverse hyperbolic tangent, rounding to the nearest.
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let atanh = c.atanh();
let expected = Complex::with_val(53, (0.4024, 1.0172));
assert!(*(atanh - expected).abs().real() < 0.0001);
sourcepub fn atanh_mut(&mut self)
pub fn atanh_mut(&mut self)
Computes the inverse hyperbolic tangent, rounding to the nearest.
§Examples
use rug::Complex;
let mut c = Complex::with_val(53, (1, 1));
c.atanh_mut();
let expected = Complex::with_val(53, (0.4024, 1.0172));
assert!(*(c - expected).abs().real() < 0.0001);
sourcepub fn atanh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
pub fn atanh_round(&mut self, round: (Round, Round)) -> (Ordering, Ordering)
Computes the inverse hyperbolic tangent, applying the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut c = Complex::with_val(4, (1, 1));
// atanh(1 + i) = (0.4024 + 1.0172i)
// using 4 significant bits: (0.40625 + i)
let dir = c.atanh_round((Round::Nearest, Round::Nearest));
assert_eq!(c, (0.40625, 1));
assert_eq!(dir, (Ordering::Greater, Ordering::Less));
sourcepub fn atanh_ref(&self) -> AtanhIncomplete<'_>
pub fn atanh_ref(&self) -> AtanhIncomplete<'_>
Computes the inverse hyperbolic tangent.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::Complex;
let c = Complex::with_val(53, (1, 1));
let atanh = Complex::with_val(53, c.atanh_ref());
let expected = Complex::with_val(53, (0.4024, 1.0172));
assert!(*(atanh - expected).abs().real() < 0.0001);
sourcepub fn agm(self, other: &Self) -> Self
pub fn agm(self, other: &Self) -> Self
Computes the arithmetic-geometric mean of self
and other
, rounding
to the nearest.
§Examples
use rug::Complex;
let f = Complex::with_val(53, (1.25, 1.0));
let g = Complex::with_val(53, (3.75, -1.0));
let agm = f.agm(&g);
let expected = Complex::with_val(53, (2.4763, 0.2571));
assert!(*(agm - expected).abs().real() < 0.0001);
sourcepub fn agm_mut(&mut self, other: &Self)
pub fn agm_mut(&mut self, other: &Self)
Computes the arithmetic-geometric mean of self
and other
, rounding
to the nearest.
§Examples
use rug::Complex;
let mut f = Complex::with_val(53, (1.25, 1.0));
let g = Complex::with_val(53, (3.75, -1.0));
f.agm_mut(&g);
let expected = Complex::with_val(53, (2.4763, 0.2571));
assert!(*(f - expected).abs().real() < 0.0001);
sourcepub fn agm_round(
&mut self,
other: &Self,
round: (Round, Round),
) -> (Ordering, Ordering)
pub fn agm_round( &mut self, other: &Self, round: (Round, Round), ) -> (Ordering, Ordering)
Computes the arithmetic-geometric mean of self
and other
, applying
the specified rounding method.
§Examples
use core::cmp::Ordering;
use rug::float::Round;
use rug::Complex;
// Use only 4 bits of precision to show rounding.
let mut f = Complex::with_val(4, (1.25, 1.0));
let g = Complex::with_val(4, (3.75, -1.0));
// agm(1.25 + 1.0i, 3.75 - 1.0i) = 2.4763 + 0.2571i
// using 4 significant bits: 2.5 + 0.25i
let dir = f.agm_round(&g, (Round::Nearest, Round::Nearest));
assert_eq!(f, (2.5, 0.25));
assert_eq!(dir, (Ordering::Greater, Ordering::Less));
sourcepub fn agm_ref<'a>(&'a self, other: &'a Self) -> AgmIncomplete<'_>
pub fn agm_ref<'a>(&'a self, other: &'a Self) -> AgmIncomplete<'_>
Computes the arithmetic-geometric mean.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
§Examples
use rug::Complex;
let f = Complex::with_val(53, (1.25, 1.0));
let g = Complex::with_val(53, (3.75, -1.0));
let agm = Complex::with_val(53, f.agm_ref(&g));
let expected = Complex::with_val(53, (2.4763, 0.2571));
assert!(*(agm - expected).abs().real() < 0.0001);
sourcepub fn random_bits(rng: &mut dyn MutRandState) -> RandomBitsIncomplete<'_>
pub fn random_bits(rng: &mut dyn MutRandState) -> RandomBitsIncomplete<'_>
Generates a random complex number with both the real and imaginary parts in the range 0 ≤ x < 1.
This is equivalent to generating a random integer in the range 0 ≤ x < 2p for each part, where 2p is two raised to the power of the precision, and then dividing the integer by 2p. The smallest non-zero result will thus be 2−p, and will only have one bit set. In the smaller possible results, many bits will be zero, and not all the precision will be used.
There is a corner case where the generated random number part is converted to NaN: if the precision is very large, the generated random number could have an exponent less than the allowed minimum exponent, and NaN is used to indicate this. For this to occur in practice, the minimum exponent has to be set to have a very small magnitude using the low-level MPFR interface, or the random number generator has to be designed specifically to trigger this case.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::rand::RandState;
use rug::{Assign, Complex};
let mut rand = RandState::new();
let mut c = Complex::new(2);
c.assign(Complex::random_bits(&mut rand));
let (re, im) = c.into_real_imag();
assert!(re == 0.0 || re == 0.25 || re == 0.5 || re == 0.75);
assert!(im == 0.0 || im == 0.25 || im == 0.5 || im == 0.75);
println!("0.0 ≤ {} < 1.0", re);
println!("0.0 ≤ {} < 1.0", im);
sourcepub fn random_cont(rng: &mut dyn MutRandState) -> RandomContIncomplete<'_>
pub fn random_cont(rng: &mut dyn MutRandState) -> RandomContIncomplete<'_>
Generates a random complex number with both the real and imaginary parts in the continous range 0 ≤ x < 1, and rounds to the nearest.
The result parts can be rounded up to be equal to one. Unlike the
random_bits
method which generates a discrete
random number at intervals depending on the precision, this method is
equivalent to generating a continuous random number with infinite
precision and then rounding the result. This means that even the smaller
numbers will be using all the available precision bits, and rounding is
performed in all cases, not in some corner case.
Rounding directions for generated random numbers cannot be
Ordering::Equal
, as the random numbers
generated can be considered to have infinite precision before rounding.
The following are implemented with the returned incomplete-computation
value as Src
:
Assign<Src> for Complex
AssignRound<Src> for Complex
CompleteRound<Completed = Complex> for Src
§Examples
use rug::rand::RandState;
use rug::Complex;
let mut rand = RandState::new();
let c = Complex::with_val(2, Complex::random_cont(&mut rand));
let (re, im) = c.into_real_imag();
// The significand is either 0b10 or 0b11
assert!(
re == 1.0
|| re == 0.75
|| re == 0.5
|| re == 0.375
|| re == 0.25
|| re <= 0.1875
);
assert!(
im == 1.0
|| im == 0.75
|| im == 0.5
|| im == 0.375
|| im == 0.25
|| im <= 0.1875
);
Trait Implementations§
source§impl AddAssign<&Complex> for Complex
impl AddAssign<&Complex> for Complex
source§fn add_assign(&mut self, rhs: &Complex)
fn add_assign(&mut self, rhs: &Complex)
+=
operation. Read moresource§impl AddAssign<&Float> for Complex
impl AddAssign<&Float> for Complex
source§fn add_assign(&mut self, rhs: &Float)
fn add_assign(&mut self, rhs: &Float)
+=
operation. Read moresource§impl AddAssign<&Integer> for Complex
impl AddAssign<&Integer> for Complex
source§fn add_assign(&mut self, rhs: &Integer)
fn add_assign(&mut self, rhs: &Integer)
+=
operation. Read moresource§impl AddAssign<&Rational> for Complex
impl AddAssign<&Rational> for Complex
source§fn add_assign(&mut self, rhs: &Rational)
fn add_assign(&mut self, rhs: &Rational)
+=
operation. Read moresource§impl AddAssign<&f32> for Complex
impl AddAssign<&f32> for Complex
source§fn add_assign(&mut self, rhs: &f32)
fn add_assign(&mut self, rhs: &f32)
+=
operation. Read moresource§impl AddAssign<&f64> for Complex
impl AddAssign<&f64> for Complex
source§fn add_assign(&mut self, rhs: &f64)
fn add_assign(&mut self, rhs: &f64)
+=
operation. Read moresource§impl AddAssign<&i128> for Complex
impl AddAssign<&i128> for Complex
source§fn add_assign(&mut self, rhs: &i128)
fn add_assign(&mut self, rhs: &i128)
+=
operation. Read moresource§impl AddAssign<&i16> for Complex
impl AddAssign<&i16> for Complex
source§fn add_assign(&mut self, rhs: &i16)
fn add_assign(&mut self, rhs: &i16)
+=
operation. Read moresource§impl AddAssign<&i32> for Complex
impl AddAssign<&i32> for Complex
source§fn add_assign(&mut self, rhs: &i32)
fn add_assign(&mut self, rhs: &i32)
+=
operation. Read moresource§impl AddAssign<&i64> for Complex
impl AddAssign<&i64> for Complex
source§fn add_assign(&mut self, rhs: &i64)
fn add_assign(&mut self, rhs: &i64)
+=
operation. Read moresource§impl AddAssign<&i8> for Complex
impl AddAssign<&i8> for Complex
source§fn add_assign(&mut self, rhs: &i8)
fn add_assign(&mut self, rhs: &i8)
+=
operation. Read moresource§impl AddAssign<&isize> for Complex
impl AddAssign<&isize> for Complex
source§fn add_assign(&mut self, rhs: &isize)
fn add_assign(&mut self, rhs: &isize)
+=
operation. Read moresource§impl AddAssign<&u128> for Complex
impl AddAssign<&u128> for Complex
source§fn add_assign(&mut self, rhs: &u128)
fn add_assign(&mut self, rhs: &u128)
+=
operation. Read moresource§impl AddAssign<&u16> for Complex
impl AddAssign<&u16> for Complex
source§fn add_assign(&mut self, rhs: &u16)
fn add_assign(&mut self, rhs: &u16)
+=
operation. Read moresource§impl AddAssign<&u32> for Complex
impl AddAssign<&u32> for Complex
source§fn add_assign(&mut self, rhs: &u32)
fn add_assign(&mut self, rhs: &u32)
+=
operation. Read moresource§impl AddAssign<&u64> for Complex
impl AddAssign<&u64> for Complex
source§fn add_assign(&mut self, rhs: &u64)
fn add_assign(&mut self, rhs: &u64)
+=
operation. Read moresource§impl AddAssign<&u8> for Complex
impl AddAssign<&u8> for Complex
source§fn add_assign(&mut self, rhs: &u8)
fn add_assign(&mut self, rhs: &u8)
+=
operation. Read moresource§impl AddAssign<&usize> for Complex
impl AddAssign<&usize> for Complex
source§fn add_assign(&mut self, rhs: &usize)
fn add_assign(&mut self, rhs: &usize)
+=
operation. Read moresource§impl AddAssign<Float> for Complex
impl AddAssign<Float> for Complex
source§fn add_assign(&mut self, rhs: Float)
fn add_assign(&mut self, rhs: Float)
+=
operation. Read moresource§impl AddAssign<Integer> for Complex
impl AddAssign<Integer> for Complex
source§fn add_assign(&mut self, rhs: Integer)
fn add_assign(&mut self, rhs: Integer)
+=
operation. Read moresource§impl AddAssign<Rational> for Complex
impl AddAssign<Rational> for Complex
source§fn add_assign(&mut self, rhs: Rational)
fn add_assign(&mut self, rhs: Rational)
+=
operation. Read moresource§impl AddAssign<f32> for Complex
impl AddAssign<f32> for Complex
source§fn add_assign(&mut self, rhs: f32)
fn add_assign(&mut self, rhs: f32)
+=
operation. Read moresource§impl AddAssign<f64> for Complex
impl AddAssign<f64> for Complex
source§fn add_assign(&mut self, rhs: f64)
fn add_assign(&mut self, rhs: f64)
+=
operation. Read moresource§impl AddAssign<i128> for Complex
impl AddAssign<i128> for Complex
source§fn add_assign(&mut self, rhs: i128)
fn add_assign(&mut self, rhs: i128)
+=
operation. Read moresource§impl AddAssign<i16> for Complex
impl AddAssign<i16> for Complex
source§fn add_assign(&mut self, rhs: i16)
fn add_assign(&mut self, rhs: i16)
+=
operation. Read moresource§impl AddAssign<i32> for Complex
impl AddAssign<i32> for Complex
source§fn add_assign(&mut self, rhs: i32)
fn add_assign(&mut self, rhs: i32)
+=
operation. Read moresource§impl AddAssign<i64> for Complex
impl AddAssign<i64> for Complex
source§fn add_assign(&mut self, rhs: i64)
fn add_assign(&mut self, rhs: i64)
+=
operation. Read moresource§impl AddAssign<i8> for Complex
impl AddAssign<i8> for Complex
source§fn add_assign(&mut self, rhs: i8)
fn add_assign(&mut self, rhs: i8)
+=
operation. Read moresource§impl AddAssign<isize> for Complex
impl AddAssign<isize> for Complex
source§fn add_assign(&mut self, rhs: isize)
fn add_assign(&mut self, rhs: isize)
+=
operation. Read moresource§impl AddAssign<u128> for Complex
impl AddAssign<u128> for Complex
source§fn add_assign(&mut self, rhs: u128)
fn add_assign(&mut self, rhs: u128)
+=
operation. Read moresource§impl AddAssign<u16> for Complex
impl AddAssign<u16> for Complex
source§fn add_assign(&mut self, rhs: u16)
fn add_assign(&mut self, rhs: u16)
+=
operation. Read moresource§impl AddAssign<u32> for Complex
impl AddAssign<u32> for Complex
source§fn add_assign(&mut self, rhs: u32)
fn add_assign(&mut self, rhs: u32)
+=
operation. Read moresource§impl AddAssign<u64> for Complex
impl AddAssign<u64> for Complex
source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
+=
operation. Read moresource§impl AddAssign<u8> for Complex
impl AddAssign<u8> for Complex
source§fn add_assign(&mut self, rhs: u8)
fn add_assign(&mut self, rhs: u8)
+=
operation. Read moresource§impl AddAssign<usize> for Complex
impl AddAssign<usize> for Complex
source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
+=
operation. Read moresource§impl AddAssign for Complex
impl AddAssign for Complex
source§fn add_assign(&mut self, rhs: Complex)
fn add_assign(&mut self, rhs: Complex)
+=
operation. Read moresource§impl AddAssignRound<&Complex> for Complex
impl AddAssignRound<&Complex> for Complex
source§impl AddAssignRound<&Float> for Complex
impl AddAssignRound<&Float> for Complex
source§impl AddAssignRound<&Integer> for Complex
impl AddAssignRound<&Integer> for Complex
source§impl AddAssignRound<&Rational> for Complex
impl AddAssignRound<&Rational> for Complex
source§impl AddAssignRound<&f32> for Complex
impl AddAssignRound<&f32> for Complex
source§impl AddAssignRound<&f64> for Complex
impl AddAssignRound<&f64> for Complex
source§impl AddAssignRound<&i128> for Complex
impl AddAssignRound<&i128> for Complex
source§impl AddAssignRound<&i16> for Complex
impl AddAssignRound<&i16> for Complex
source§impl AddAssignRound<&i32> for Complex
impl AddAssignRound<&i32> for Complex
source§impl AddAssignRound<&i64> for Complex
impl AddAssignRound<&i64> for Complex
source§impl AddAssignRound<&i8> for Complex
impl AddAssignRound<&i8> for Complex
source§impl AddAssignRound<&isize> for Complex
impl AddAssignRound<&isize> for Complex
source§impl AddAssignRound<&u128> for Complex
impl AddAssignRound<&u128> for Complex
source§impl AddAssignRound<&u16> for Complex
impl AddAssignRound<&u16> for Complex
source§impl AddAssignRound<&u32> for Complex
impl AddAssignRound<&u32> for Complex
source§impl AddAssignRound<&u64> for Complex
impl AddAssignRound<&u64> for Complex
source§impl AddAssignRound<&u8> for Complex
impl AddAssignRound<&u8> for Complex
source§impl AddAssignRound<&usize> for Complex
impl AddAssignRound<&usize> for Complex
source§impl AddAssignRound<Float> for Complex
impl AddAssignRound<Float> for Complex
source§impl AddAssignRound<Integer> for Complex
impl AddAssignRound<Integer> for Complex
source§impl AddAssignRound<Rational> for Complex
impl AddAssignRound<Rational> for Complex
source§impl AddAssignRound<f32> for Complex
impl AddAssignRound<f32> for Complex
source§impl AddAssignRound<f64> for Complex
impl AddAssignRound<f64> for Complex
source§impl AddAssignRound<i128> for Complex
impl AddAssignRound<i128> for Complex
source§impl AddAssignRound<i16> for Complex
impl AddAssignRound<i16> for Complex
source§impl AddAssignRound<i32> for Complex
impl AddAssignRound<i32> for Complex
source§impl AddAssignRound<i64> for Complex
impl AddAssignRound<i64> for Complex
source§impl AddAssignRound<i8> for Complex
impl AddAssignRound<i8> for Complex
source§impl AddAssignRound<isize> for Complex
impl AddAssignRound<isize> for Complex
source§impl AddAssignRound<u128> for Complex
impl AddAssignRound<u128> for Complex
source§impl AddAssignRound<u16> for Complex
impl AddAssignRound<u16> for Complex
source§impl AddAssignRound<u32> for Complex
impl AddAssignRound<u32> for Complex
source§impl AddAssignRound<u64> for Complex
impl AddAssignRound<u64> for Complex
source§impl AddAssignRound<u8> for Complex
impl AddAssignRound<u8> for Complex
source§impl AddAssignRound<usize> for Complex
impl AddAssignRound<usize> for Complex
source§impl AddAssignRound for Complex
impl AddAssignRound for Complex
source§impl AddFromRound<&Complex> for Complex
impl AddFromRound<&Complex> for Complex
source§impl AddFromRound<&Float> for Complex
impl AddFromRound<&Float> for Complex
source§impl AddFromRound<&Integer> for Complex
impl AddFromRound<&Integer> for Complex
source§impl AddFromRound<&Rational> for Complex
impl AddFromRound<&Rational> for Complex
source§impl AddFromRound<&f32> for Complex
impl AddFromRound<&f32> for Complex
source§impl AddFromRound<&f64> for Complex
impl AddFromRound<&f64> for Complex
source§impl AddFromRound<&i128> for Complex
impl AddFromRound<&i128> for Complex
source§impl AddFromRound<&i16> for Complex
impl AddFromRound<&i16> for Complex
source§impl AddFromRound<&i32> for Complex
impl AddFromRound<&i32> for Complex
source§impl AddFromRound<&i64> for Complex
impl AddFromRound<&i64> for Complex
source§impl AddFromRound<&i8> for Complex
impl AddFromRound<&i8> for Complex
source§impl AddFromRound<&isize> for Complex
impl AddFromRound<&isize> for Complex
source§impl AddFromRound<&u128> for Complex
impl AddFromRound<&u128> for Complex
source§impl AddFromRound<&u16> for Complex
impl AddFromRound<&u16> for Complex
source§impl AddFromRound<&u32> for Complex
impl AddFromRound<&u32> for Complex
source§impl AddFromRound<&u64> for Complex
impl AddFromRound<&u64> for Complex
source§impl AddFromRound<&u8> for Complex
impl AddFromRound<&u8> for Complex
source§impl AddFromRound<&usize> for Complex
impl AddFromRound<&usize> for Complex
source§impl AddFromRound<Float> for Complex
impl AddFromRound<Float> for Complex
source§impl AddFromRound<Integer> for Complex
impl AddFromRound<Integer> for Complex
source§impl AddFromRound<Rational> for Complex
impl AddFromRound<Rational> for Complex
source§impl AddFromRound<f32> for Complex
impl AddFromRound<f32> for Complex
source§impl AddFromRound<f64> for Complex
impl AddFromRound<f64> for Complex
source§impl AddFromRound<i128> for Complex
impl AddFromRound<i128> for Complex
source§impl AddFromRound<i16> for Complex
impl AddFromRound<i16> for Complex
source§impl AddFromRound<i32> for Complex
impl AddFromRound<i32> for Complex
source§impl AddFromRound<i64> for Complex
impl AddFromRound<i64> for Complex
source§impl AddFromRound<i8> for Complex
impl AddFromRound<i8> for Complex
source§impl AddFromRound<isize> for Complex
impl AddFromRound<isize> for Complex
source§impl AddFromRound<u128> for Complex
impl AddFromRound<u128> for Complex
source§impl AddFromRound<u16> for Complex
impl AddFromRound<u16> for Complex
source§impl AddFromRound<u32> for Complex
impl AddFromRound<u32> for Complex
source§impl AddFromRound<u64> for Complex
impl AddFromRound<u64> for Complex
source§impl AddFromRound<u8> for Complex
impl AddFromRound<u8> for Complex
source§impl AddFromRound<usize> for Complex
impl AddFromRound<usize> for Complex
source§impl AddFromRound for Complex
impl AddFromRound for Complex
source§impl AsMut<Complex> for OrdComplex
impl AsMut<Complex> for OrdComplex
source§impl AsRef<Complex> for OrdComplex
impl AsRef<Complex> for OrdComplex
source§impl AsRef<OrdComplex> for Complex
impl AsRef<OrdComplex> for Complex
source§fn as_ref(&self) -> &OrdComplex
fn as_ref(&self) -> &OrdComplex
source§impl<'a, Re, Im> AssignRound<&'a (Re, Im)> for Complexwhere
Float: AssignRound<&'a Re, Round = Round, Ordering = Ordering> + AssignRound<&'a Im, Round = Round, Ordering = Ordering>,
impl<'a, Re, Im> AssignRound<&'a (Re, Im)> for Complexwhere
Float: AssignRound<&'a Re, Round = Round, Ordering = Ordering> + AssignRound<&'a Im, Round = Round, Ordering = Ordering>,
source§impl AssignRound<&Complex> for Complex
impl AssignRound<&Complex> for Complex
source§impl AssignRound<&MiniComplex> for Complex
impl AssignRound<&MiniComplex> for Complex
source§impl AssignRound<&SmallComplex> for Complex
impl AssignRound<&SmallComplex> for Complex
source§impl<Re, Im> AssignRound<(Re, Im)> for Complexwhere
Float: AssignRound<Re, Round = Round, Ordering = Ordering> + AssignRound<Im, Round = Round, Ordering = Ordering>,
impl<Re, Im> AssignRound<(Re, Im)> for Complexwhere
Float: AssignRound<Re, Round = Round, Ordering = Ordering> + AssignRound<Im, Round = Round, Ordering = Ordering>,
source§impl AssignRound<MiniComplex> for Complex
impl AssignRound<MiniComplex> for Complex
source§impl<Re> AssignRound<Re> for Complex
impl<Re> AssignRound<Re> for Complex
source§impl AssignRound<SmallComplex> for Complex
impl AssignRound<SmallComplex> for Complex
source§impl AssignRound for Complex
impl AssignRound for Complex
source§impl<'de> Deserialize<'de> for Complex
impl<'de> Deserialize<'de> for Complex
source§fn deserialize<D: Deserializer<'de>>(
deserializer: D,
) -> Result<Complex, D::Error>
fn deserialize<D: Deserializer<'de>>( deserializer: D, ) -> Result<Complex, D::Error>
source§impl DivAssign<&Complex> for Complex
impl DivAssign<&Complex> for Complex
source§fn div_assign(&mut self, rhs: &Complex)
fn div_assign(&mut self, rhs: &Complex)
/=
operation. Read moresource§impl DivAssign<&Float> for Complex
impl DivAssign<&Float> for Complex
source§fn div_assign(&mut self, rhs: &Float)
fn div_assign(&mut self, rhs: &Float)
/=
operation. Read moresource§impl DivAssign<&Integer> for Complex
impl DivAssign<&Integer> for Complex
source§fn div_assign(&mut self, rhs: &Integer)
fn div_assign(&mut self, rhs: &Integer)
/=
operation. Read moresource§impl DivAssign<&Rational> for Complex
impl DivAssign<&Rational> for Complex
source§fn div_assign(&mut self, rhs: &Rational)
fn div_assign(&mut self, rhs: &Rational)
/=
operation. Read moresource§impl DivAssign<&f32> for Complex
impl DivAssign<&f32> for Complex
source§fn div_assign(&mut self, rhs: &f32)
fn div_assign(&mut self, rhs: &f32)
/=
operation. Read moresource§impl DivAssign<&f64> for Complex
impl DivAssign<&f64> for Complex
source§fn div_assign(&mut self, rhs: &f64)
fn div_assign(&mut self, rhs: &f64)
/=
operation. Read moresource§impl DivAssign<&i128> for Complex
impl DivAssign<&i128> for Complex
source§fn div_assign(&mut self, rhs: &i128)
fn div_assign(&mut self, rhs: &i128)
/=
operation. Read moresource§impl DivAssign<&i16> for Complex
impl DivAssign<&i16> for Complex
source§fn div_assign(&mut self, rhs: &i16)
fn div_assign(&mut self, rhs: &i16)
/=
operation. Read moresource§impl DivAssign<&i32> for Complex
impl DivAssign<&i32> for Complex
source§fn div_assign(&mut self, rhs: &i32)
fn div_assign(&mut self, rhs: &i32)
/=
operation. Read moresource§impl DivAssign<&i64> for Complex
impl DivAssign<&i64> for Complex
source§fn div_assign(&mut self, rhs: &i64)
fn div_assign(&mut self, rhs: &i64)
/=
operation. Read moresource§impl DivAssign<&i8> for Complex
impl DivAssign<&i8> for Complex
source§fn div_assign(&mut self, rhs: &i8)
fn div_assign(&mut self, rhs: &i8)
/=
operation. Read moresource§impl DivAssign<&isize> for Complex
impl DivAssign<&isize> for Complex
source§fn div_assign(&mut self, rhs: &isize)
fn div_assign(&mut self, rhs: &isize)
/=
operation. Read moresource§impl DivAssign<&u128> for Complex
impl DivAssign<&u128> for Complex
source§fn div_assign(&mut self, rhs: &u128)
fn div_assign(&mut self, rhs: &u128)
/=
operation. Read moresource§impl DivAssign<&u16> for Complex
impl DivAssign<&u16> for Complex
source§fn div_assign(&mut self, rhs: &u16)
fn div_assign(&mut self, rhs: &u16)
/=
operation. Read moresource§impl DivAssign<&u32> for Complex
impl DivAssign<&u32> for Complex
source§fn div_assign(&mut self, rhs: &u32)
fn div_assign(&mut self, rhs: &u32)
/=
operation. Read moresource§impl DivAssign<&u64> for Complex
impl DivAssign<&u64> for Complex
source§fn div_assign(&mut self, rhs: &u64)
fn div_assign(&mut self, rhs: &u64)
/=
operation. Read moresource§impl DivAssign<&u8> for Complex
impl DivAssign<&u8> for Complex
source§fn div_assign(&mut self, rhs: &u8)
fn div_assign(&mut self, rhs: &u8)
/=
operation. Read moresource§impl DivAssign<&usize> for Complex
impl DivAssign<&usize> for Complex
source§fn div_assign(&mut self, rhs: &usize)
fn div_assign(&mut self, rhs: &usize)
/=
operation. Read moresource§impl DivAssign<Float> for Complex
impl DivAssign<Float> for Complex
source§fn div_assign(&mut self, rhs: Float)
fn div_assign(&mut self, rhs: Float)
/=
operation. Read moresource§impl DivAssign<Integer> for Complex
impl DivAssign<Integer> for Complex
source§fn div_assign(&mut self, rhs: Integer)
fn div_assign(&mut self, rhs: Integer)
/=
operation. Read moresource§impl DivAssign<Rational> for Complex
impl DivAssign<Rational> for Complex
source§fn div_assign(&mut self, rhs: Rational)
fn div_assign(&mut self, rhs: Rational)
/=
operation. Read moresource§impl DivAssign<f32> for Complex
impl DivAssign<f32> for Complex
source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
/=
operation. Read moresource§impl DivAssign<f64> for Complex
impl DivAssign<f64> for Complex
source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
/=
operation. Read moresource§impl DivAssign<i128> for Complex
impl DivAssign<i128> for Complex
source§fn div_assign(&mut self, rhs: i128)
fn div_assign(&mut self, rhs: i128)
/=
operation. Read moresource§impl DivAssign<i16> for Complex
impl DivAssign<i16> for Complex
source§fn div_assign(&mut self, rhs: i16)
fn div_assign(&mut self, rhs: i16)
/=
operation. Read moresource§impl DivAssign<i32> for Complex
impl DivAssign<i32> for Complex
source§fn div_assign(&mut self, rhs: i32)
fn div_assign(&mut self, rhs: i32)
/=
operation. Read moresource§impl DivAssign<i64> for Complex
impl DivAssign<i64> for Complex
source§fn div_assign(&mut self, rhs: i64)
fn div_assign(&mut self, rhs: i64)
/=
operation. Read moresource§impl DivAssign<i8> for Complex
impl DivAssign<i8> for Complex
source§fn div_assign(&mut self, rhs: i8)
fn div_assign(&mut self, rhs: i8)
/=
operation. Read moresource§impl DivAssign<isize> for Complex
impl DivAssign<isize> for Complex
source§fn div_assign(&mut self, rhs: isize)
fn div_assign(&mut self, rhs: isize)
/=
operation. Read moresource§impl DivAssign<u128> for Complex
impl DivAssign<u128> for Complex
source§fn div_assign(&mut self, rhs: u128)
fn div_assign(&mut self, rhs: u128)
/=
operation. Read moresource§impl DivAssign<u16> for Complex
impl DivAssign<u16> for Complex
source§fn div_assign(&mut self, rhs: u16)
fn div_assign(&mut self, rhs: u16)
/=
operation. Read moresource§impl DivAssign<u32> for Complex
impl DivAssign<u32> for Complex
source§fn div_assign(&mut self, rhs: u32)
fn div_assign(&mut self, rhs: u32)
/=
operation. Read moresource§impl DivAssign<u64> for Complex
impl DivAssign<u64> for Complex
source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
/=
operation. Read moresource§impl DivAssign<u8> for Complex
impl DivAssign<u8> for Complex
source§fn div_assign(&mut self, rhs: u8)
fn div_assign(&mut self, rhs: u8)
/=
operation. Read moresource§impl DivAssign<usize> for Complex
impl DivAssign<usize> for Complex
source§fn div_assign(&mut self, rhs: usize)
fn div_assign(&mut self, rhs: usize)
/=
operation. Read moresource§impl DivAssign for Complex
impl DivAssign for Complex
source§fn div_assign(&mut self, rhs: Complex)
fn div_assign(&mut self, rhs: Complex)
/=
operation. Read moresource§impl DivAssignRound<&Complex> for Complex
impl DivAssignRound<&Complex> for Complex
source§impl DivAssignRound<&Float> for Complex
impl DivAssignRound<&Float> for Complex
source§impl DivAssignRound<&Integer> for Complex
impl DivAssignRound<&Integer> for Complex
source§impl DivAssignRound<&Rational> for Complex
impl DivAssignRound<&Rational> for Complex
source§impl DivAssignRound<&f32> for Complex
impl DivAssignRound<&f32> for Complex
source§impl DivAssignRound<&f64> for Complex
impl DivAssignRound<&f64> for Complex
source§impl DivAssignRound<&i128> for Complex
impl DivAssignRound<&i128> for Complex
source§impl DivAssignRound<&i16> for Complex
impl DivAssignRound<&i16> for Complex
source§impl DivAssignRound<&i32> for Complex
impl DivAssignRound<&i32> for Complex
source§impl DivAssignRound<&i64> for Complex
impl DivAssignRound<&i64> for Complex
source§impl DivAssignRound<&i8> for Complex
impl DivAssignRound<&i8> for Complex
source§impl DivAssignRound<&isize> for Complex
impl DivAssignRound<&isize> for Complex
source§impl DivAssignRound<&u128> for Complex
impl DivAssignRound<&u128> for Complex
source§impl DivAssignRound<&u16> for Complex
impl DivAssignRound<&u16> for Complex
source§impl DivAssignRound<&u32> for Complex
impl DivAssignRound<&u32> for Complex
source§impl DivAssignRound<&u64> for Complex
impl DivAssignRound<&u64> for Complex
source§impl DivAssignRound<&u8> for Complex
impl DivAssignRound<&u8> for Complex
source§impl DivAssignRound<&usize> for Complex
impl DivAssignRound<&usize> for Complex
source§impl DivAssignRound<Float> for Complex
impl DivAssignRound<Float> for Complex
source§impl DivAssignRound<Integer> for Complex
impl DivAssignRound<Integer> for Complex
source§impl DivAssignRound<Rational> for Complex
impl DivAssignRound<Rational> for Complex
source§impl DivAssignRound<f32> for Complex
impl DivAssignRound<f32> for Complex
source§impl DivAssignRound<f64> for Complex
impl DivAssignRound<f64> for Complex
source§impl DivAssignRound<i128> for Complex
impl DivAssignRound<i128> for Complex
source§impl DivAssignRound<i16> for Complex
impl DivAssignRound<i16> for Complex
source§impl DivAssignRound<i32> for Complex
impl DivAssignRound<i32> for Complex
source§impl DivAssignRound<i64> for Complex
impl DivAssignRound<i64> for Complex
source§impl DivAssignRound<i8> for Complex
impl DivAssignRound<i8> for Complex
source§impl DivAssignRound<isize> for Complex
impl DivAssignRound<isize> for Complex
source§impl DivAssignRound<u128> for Complex
impl DivAssignRound<u128> for Complex
source§impl DivAssignRound<u16> for Complex
impl DivAssignRound<u16> for Complex
source§impl DivAssignRound<u32> for Complex
impl DivAssignRound<u32> for Complex
source§impl DivAssignRound<u64> for Complex
impl DivAssignRound<u64> for Complex
source§impl DivAssignRound<u8> for Complex
impl DivAssignRound<u8> for Complex
source§impl DivAssignRound<usize> for Complex
impl DivAssignRound<usize> for Complex
source§impl DivAssignRound for Complex
impl DivAssignRound for Complex
source§impl DivFromRound<&Complex> for Complex
impl DivFromRound<&Complex> for Complex
source§impl DivFromRound<&Float> for Complex
impl DivFromRound<&Float> for Complex
source§impl DivFromRound<&f32> for Complex
impl DivFromRound<&f32> for Complex
source§impl DivFromRound<&f64> for Complex
impl DivFromRound<&f64> for Complex
source§impl DivFromRound<&i128> for Complex
impl DivFromRound<&i128> for Complex
source§impl DivFromRound<&i16> for Complex
impl DivFromRound<&i16> for Complex
source§impl DivFromRound<&i32> for Complex
impl DivFromRound<&i32> for Complex
source§impl DivFromRound<&i64> for Complex
impl DivFromRound<&i64> for Complex
source§impl DivFromRound<&i8> for Complex
impl DivFromRound<&i8> for Complex
source§impl DivFromRound<&isize> for Complex
impl DivFromRound<&isize> for Complex
source§impl DivFromRound<&u128> for Complex
impl DivFromRound<&u128> for Complex
source§impl DivFromRound<&u16> for Complex
impl DivFromRound<&u16> for Complex
source§impl DivFromRound<&u32> for Complex
impl DivFromRound<&u32> for Complex
source§impl DivFromRound<&u64> for Complex
impl DivFromRound<&u64> for Complex
source§impl DivFromRound<&u8> for Complex
impl DivFromRound<&u8> for Complex
source§impl DivFromRound<&usize> for Complex
impl DivFromRound<&usize> for Complex
source§impl DivFromRound<Float> for Complex
impl DivFromRound<Float> for Complex
source§impl DivFromRound<f32> for Complex
impl DivFromRound<f32> for Complex
source§impl DivFromRound<f64> for Complex
impl DivFromRound<f64> for Complex
source§impl DivFromRound<i128> for Complex
impl DivFromRound<i128> for Complex
source§impl DivFromRound<i16> for Complex
impl DivFromRound<i16> for Complex
source§impl DivFromRound<i32> for Complex
impl DivFromRound<i32> for Complex
source§impl DivFromRound<i64> for Complex
impl DivFromRound<i64> for Complex
source§impl DivFromRound<i8> for Complex
impl DivFromRound<i8> for Complex
source§impl DivFromRound<isize> for Complex
impl DivFromRound<isize> for Complex
source§impl DivFromRound<u128> for Complex
impl DivFromRound<u128> for Complex
source§impl DivFromRound<u16> for Complex
impl DivFromRound<u16> for Complex
source§impl DivFromRound<u32> for Complex
impl DivFromRound<u32> for Complex
source§impl DivFromRound<u64> for Complex
impl DivFromRound<u64> for Complex
source§impl DivFromRound<u8> for Complex
impl DivFromRound<u8> for Complex
source§impl DivFromRound<usize> for Complex
impl DivFromRound<usize> for Complex
source§impl DivFromRound for Complex
impl DivFromRound for Complex
source§impl From<Complex> for OrdComplex
impl From<Complex> for OrdComplex
source§impl From<OrdComplex> for Complex
impl From<OrdComplex> for Complex
source§fn from(src: OrdComplex) -> Self
fn from(src: OrdComplex) -> Self
source§impl MulAddAssign<&Complex, &Complex> for Complex
impl MulAddAssign<&Complex, &Complex> for Complex
source§fn mul_add_assign(&mut self, a: &Complex, b: &Complex)
fn mul_add_assign(&mut self, a: &Complex, b: &Complex)
*self = (*self * a) + b
source§impl MulAddAssign for Complex
impl MulAddAssign for Complex
source§fn mul_add_assign(&mut self, a: Complex, b: Complex)
fn mul_add_assign(&mut self, a: Complex, b: Complex)
*self = (*self * a) + b
source§impl MulAssign<&Complex> for Complex
impl MulAssign<&Complex> for Complex
source§fn mul_assign(&mut self, rhs: &Complex)
fn mul_assign(&mut self, rhs: &Complex)
*=
operation. Read moresource§impl MulAssign<&Float> for Complex
impl MulAssign<&Float> for Complex
source§fn mul_assign(&mut self, rhs: &Float)
fn mul_assign(&mut self, rhs: &Float)
*=
operation. Read moresource§impl MulAssign<&Integer> for Complex
impl MulAssign<&Integer> for Complex
source§fn mul_assign(&mut self, rhs: &Integer)
fn mul_assign(&mut self, rhs: &Integer)
*=
operation. Read moresource§impl MulAssign<&Rational> for Complex
impl MulAssign<&Rational> for Complex
source§fn mul_assign(&mut self, rhs: &Rational)
fn mul_assign(&mut self, rhs: &Rational)
*=
operation. Read moresource§impl MulAssign<&f32> for Complex
impl MulAssign<&f32> for Complex
source§fn mul_assign(&mut self, rhs: &f32)
fn mul_assign(&mut self, rhs: &f32)
*=
operation. Read moresource§impl MulAssign<&f64> for Complex
impl MulAssign<&f64> for Complex
source§fn mul_assign(&mut self, rhs: &f64)
fn mul_assign(&mut self, rhs: &f64)
*=
operation. Read moresource§impl MulAssign<&i128> for Complex
impl MulAssign<&i128> for Complex
source§fn mul_assign(&mut self, rhs: &i128)
fn mul_assign(&mut self, rhs: &i128)
*=
operation. Read moresource§impl MulAssign<&i16> for Complex
impl MulAssign<&i16> for Complex
source§fn mul_assign(&mut self, rhs: &i16)
fn mul_assign(&mut self, rhs: &i16)
*=
operation. Read moresource§impl MulAssign<&i32> for Complex
impl MulAssign<&i32> for Complex
source§fn mul_assign(&mut self, rhs: &i32)
fn mul_assign(&mut self, rhs: &i32)
*=
operation. Read moresource§impl MulAssign<&i64> for Complex
impl MulAssign<&i64> for Complex
source§fn mul_assign(&mut self, rhs: &i64)
fn mul_assign(&mut self, rhs: &i64)
*=
operation. Read moresource§impl MulAssign<&i8> for Complex
impl MulAssign<&i8> for Complex
source§fn mul_assign(&mut self, rhs: &i8)
fn mul_assign(&mut self, rhs: &i8)
*=
operation. Read moresource§impl MulAssign<&isize> for Complex
impl MulAssign<&isize> for Complex
source§fn mul_assign(&mut self, rhs: &isize)
fn mul_assign(&mut self, rhs: &isize)
*=
operation. Read moresource§impl MulAssign<&u128> for Complex
impl MulAssign<&u128> for Complex
source§fn mul_assign(&mut self, rhs: &u128)
fn mul_assign(&mut self, rhs: &u128)
*=
operation. Read moresource§impl MulAssign<&u16> for Complex
impl MulAssign<&u16> for Complex
source§fn mul_assign(&mut self, rhs: &u16)
fn mul_assign(&mut self, rhs: &u16)
*=
operation. Read moresource§impl MulAssign<&u32> for Complex
impl MulAssign<&u32> for Complex
source§fn mul_assign(&mut self, rhs: &u32)
fn mul_assign(&mut self, rhs: &u32)
*=
operation. Read moresource§impl MulAssign<&u64> for Complex
impl MulAssign<&u64> for Complex
source§fn mul_assign(&mut self, rhs: &u64)
fn mul_assign(&mut self, rhs: &u64)
*=
operation. Read moresource§impl MulAssign<&u8> for Complex
impl MulAssign<&u8> for Complex
source§fn mul_assign(&mut self, rhs: &u8)
fn mul_assign(&mut self, rhs: &u8)
*=
operation. Read moresource§impl MulAssign<&usize> for Complex
impl MulAssign<&usize> for Complex
source§fn mul_assign(&mut self, rhs: &usize)
fn mul_assign(&mut self, rhs: &usize)
*=
operation. Read moresource§impl MulAssign<Float> for Complex
impl MulAssign<Float> for Complex
source§fn mul_assign(&mut self, rhs: Float)
fn mul_assign(&mut self, rhs: Float)
*=
operation. Read moresource§impl MulAssign<Integer> for Complex
impl MulAssign<Integer> for Complex
source§fn mul_assign(&mut self, rhs: Integer)
fn mul_assign(&mut self, rhs: Integer)
*=
operation. Read moresource§impl MulAssign<Rational> for Complex
impl MulAssign<Rational> for Complex
source§fn mul_assign(&mut self, rhs: Rational)
fn mul_assign(&mut self, rhs: Rational)
*=
operation. Read moresource§impl MulAssign<f32> for Complex
impl MulAssign<f32> for Complex
source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
*=
operation. Read moresource§impl MulAssign<f64> for Complex
impl MulAssign<f64> for Complex
source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
*=
operation. Read moresource§impl MulAssign<i128> for Complex
impl MulAssign<i128> for Complex
source§fn mul_assign(&mut self, rhs: i128)
fn mul_assign(&mut self, rhs: i128)
*=
operation. Read moresource§impl MulAssign<i16> for Complex
impl MulAssign<i16> for Complex
source§fn mul_assign(&mut self, rhs: i16)
fn mul_assign(&mut self, rhs: i16)
*=
operation. Read moresource§impl MulAssign<i32> for Complex
impl MulAssign<i32> for Complex
source§fn mul_assign(&mut self, rhs: i32)
fn mul_assign(&mut self, rhs: i32)
*=
operation. Read moresource§impl MulAssign<i64> for Complex
impl MulAssign<i64> for Complex
source§fn mul_assign(&mut self, rhs: i64)
fn mul_assign(&mut self, rhs: i64)
*=
operation. Read moresource§impl MulAssign<i8> for Complex
impl MulAssign<i8> for Complex
source§fn mul_assign(&mut self, rhs: i8)
fn mul_assign(&mut self, rhs: i8)
*=
operation. Read moresource§impl MulAssign<isize> for Complex
impl MulAssign<isize> for Complex
source§fn mul_assign(&mut self, rhs: isize)
fn mul_assign(&mut self, rhs: isize)
*=
operation. Read moresource§impl MulAssign<u128> for Complex
impl MulAssign<u128> for Complex
source§fn mul_assign(&mut self, rhs: u128)
fn mul_assign(&mut self, rhs: u128)
*=
operation. Read moresource§impl MulAssign<u16> for Complex
impl MulAssign<u16> for Complex
source§fn mul_assign(&mut self, rhs: u16)
fn mul_assign(&mut self, rhs: u16)
*=
operation. Read moresource§impl MulAssign<u32> for Complex
impl MulAssign<u32> for Complex
source§fn mul_assign(&mut self, rhs: u32)
fn mul_assign(&mut self, rhs: u32)
*=
operation. Read moresource§impl MulAssign<u64> for Complex
impl MulAssign<u64> for Complex
source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
*=
operation. Read moresource§impl MulAssign<u8> for Complex
impl MulAssign<u8> for Complex
source§fn mul_assign(&mut self, rhs: u8)
fn mul_assign(&mut self, rhs: u8)
*=
operation. Read moresource§impl MulAssign<usize> for Complex
impl MulAssign<usize> for Complex
source§fn mul_assign(&mut self, rhs: usize)
fn mul_assign(&mut self, rhs: usize)
*=
operation. Read moresource§impl MulAssign for Complex
impl MulAssign for Complex
source§fn mul_assign(&mut self, rhs: Complex)
fn mul_assign(&mut self, rhs: Complex)
*=
operation. Read moresource§impl MulAssignRound<&Complex> for Complex
impl MulAssignRound<&Complex> for Complex
source§impl MulAssignRound<&Float> for Complex
impl MulAssignRound<&Float> for Complex
source§impl MulAssignRound<&Integer> for Complex
impl MulAssignRound<&Integer> for Complex
source§impl MulAssignRound<&Rational> for Complex
impl MulAssignRound<&Rational> for Complex
source§impl MulAssignRound<&f32> for Complex
impl MulAssignRound<&f32> for Complex
source§impl MulAssignRound<&f64> for Complex
impl MulAssignRound<&f64> for Complex
source§impl MulAssignRound<&i128> for Complex
impl MulAssignRound<&i128> for Complex
source§impl MulAssignRound<&i16> for Complex
impl MulAssignRound<&i16> for Complex
source§impl MulAssignRound<&i32> for Complex
impl MulAssignRound<&i32> for Complex
source§impl MulAssignRound<&i64> for Complex
impl MulAssignRound<&i64> for Complex
source§impl MulAssignRound<&i8> for Complex
impl MulAssignRound<&i8> for Complex
source§impl MulAssignRound<&isize> for Complex
impl MulAssignRound<&isize> for Complex
source§impl MulAssignRound<&u128> for Complex
impl MulAssignRound<&u128> for Complex
source§impl MulAssignRound<&u16> for Complex
impl MulAssignRound<&u16> for Complex
source§impl MulAssignRound<&u32> for Complex
impl MulAssignRound<&u32> for Complex
source§impl MulAssignRound<&u64> for Complex
impl MulAssignRound<&u64> for Complex
source§impl MulAssignRound<&u8> for Complex
impl MulAssignRound<&u8> for Complex
source§impl MulAssignRound<&usize> for Complex
impl MulAssignRound<&usize> for Complex
source§impl MulAssignRound<Float> for Complex
impl MulAssignRound<Float> for Complex
source§impl MulAssignRound<Integer> for Complex
impl MulAssignRound<Integer> for Complex
source§impl MulAssignRound<Rational> for Complex
impl MulAssignRound<Rational> for Complex
source§impl MulAssignRound<f32> for Complex
impl MulAssignRound<f32> for Complex
source§impl MulAssignRound<f64> for Complex
impl MulAssignRound<f64> for Complex
source§impl MulAssignRound<i128> for Complex
impl MulAssignRound<i128> for Complex
source§impl MulAssignRound<i16> for Complex
impl MulAssignRound<i16> for Complex
source§impl MulAssignRound<i32> for Complex
impl MulAssignRound<i32> for Complex
source§impl MulAssignRound<i64> for Complex
impl MulAssignRound<i64> for Complex
source§impl MulAssignRound<i8> for Complex
impl MulAssignRound<i8> for Complex
source§impl MulAssignRound<isize> for Complex
impl MulAssignRound<isize> for Complex
source§impl MulAssignRound<u128> for Complex
impl MulAssignRound<u128> for Complex
source§impl MulAssignRound<u16> for Complex
impl MulAssignRound<u16> for Complex
source§impl MulAssignRound<u32> for Complex
impl MulAssignRound<u32> for Complex
source§impl MulAssignRound<u64> for Complex
impl MulAssignRound<u64> for Complex
source§impl MulAssignRound<u8> for Complex
impl MulAssignRound<u8> for Complex
source§impl MulAssignRound<usize> for Complex
impl MulAssignRound<usize> for Complex
source§impl MulAssignRound for Complex
impl MulAssignRound for Complex
source§impl MulFromRound<&Complex> for Complex
impl MulFromRound<&Complex> for Complex
source§impl MulFromRound<&Float> for Complex
impl MulFromRound<&Float> for Complex
source§impl MulFromRound<&Integer> for Complex
impl MulFromRound<&Integer> for Complex
source§impl MulFromRound<&Rational> for Complex
impl MulFromRound<&Rational> for Complex
source§impl MulFromRound<&f32> for Complex
impl MulFromRound<&f32> for Complex
source§impl MulFromRound<&f64> for Complex
impl MulFromRound<&f64> for Complex
source§impl MulFromRound<&i128> for Complex
impl MulFromRound<&i128> for Complex
source§impl MulFromRound<&i16> for Complex
impl MulFromRound<&i16> for Complex
source§impl MulFromRound<&i32> for Complex
impl MulFromRound<&i32> for Complex
source§impl MulFromRound<&i64> for Complex
impl MulFromRound<&i64> for Complex
source§impl MulFromRound<&i8> for Complex
impl MulFromRound<&i8> for Complex
source§impl MulFromRound<&isize> for Complex
impl MulFromRound<&isize> for Complex
source§impl MulFromRound<&u128> for Complex
impl MulFromRound<&u128> for Complex
source§impl MulFromRound<&u16> for Complex
impl MulFromRound<&u16> for Complex
source§impl MulFromRound<&u32> for Complex
impl MulFromRound<&u32> for Complex
source§impl MulFromRound<&u64> for Complex
impl MulFromRound<&u64> for Complex
source§impl MulFromRound<&u8> for Complex
impl MulFromRound<&u8> for Complex
source§impl MulFromRound<&usize> for Complex
impl MulFromRound<&usize> for Complex
source§impl MulFromRound<Float> for Complex
impl MulFromRound<Float> for Complex
source§impl MulFromRound<Integer> for Complex
impl MulFromRound<Integer> for Complex
source§impl MulFromRound<Rational> for Complex
impl MulFromRound<Rational> for Complex
source§impl MulFromRound<f32> for Complex
impl MulFromRound<f32> for Complex
source§impl MulFromRound<f64> for Complex
impl MulFromRound<f64> for Complex
source§impl MulFromRound<i128> for Complex
impl MulFromRound<i128> for Complex
source§impl MulFromRound<i16> for Complex
impl MulFromRound<i16> for Complex
source§impl MulFromRound<i32> for Complex
impl MulFromRound<i32> for Complex
source§impl MulFromRound<i64> for Complex
impl MulFromRound<i64> for Complex
source§impl MulFromRound<i8> for Complex
impl MulFromRound<i8> for Complex
source§impl MulFromRound<isize> for Complex
impl MulFromRound<isize> for Complex
source§impl MulFromRound<u128> for Complex
impl MulFromRound<u128> for Complex
source§impl MulFromRound<u16> for Complex
impl MulFromRound<u16> for Complex
source§impl MulFromRound<u32> for Complex
impl MulFromRound<u32> for Complex
source§impl MulFromRound<u64> for Complex
impl MulFromRound<u64> for Complex
source§impl MulFromRound<u8> for Complex
impl MulFromRound<u8> for Complex
source§impl MulFromRound<usize> for Complex
impl MulFromRound<usize> for Complex
source§impl MulFromRound for Complex
impl MulFromRound for Complex
source§impl PartialEq<Complex> for MiniComplex
impl PartialEq<Complex> for MiniComplex
source§impl PartialEq<Complex> for SmallComplex
impl PartialEq<Complex> for SmallComplex
source§impl PartialEq<MiniComplex> for Complex
impl PartialEq<MiniComplex> for Complex
source§impl PartialEq<SmallComplex> for Complex
impl PartialEq<SmallComplex> for Complex
source§impl PowAssign<&Complex> for Complex
impl PowAssign<&Complex> for Complex
source§fn pow_assign(&mut self, rhs: &Complex)
fn pow_assign(&mut self, rhs: &Complex)
source§impl PowAssign<&Float> for Complex
impl PowAssign<&Float> for Complex
source§fn pow_assign(&mut self, rhs: &Float)
fn pow_assign(&mut self, rhs: &Float)
source§impl PowAssign<&Integer> for Complex
impl PowAssign<&Integer> for Complex
source§fn pow_assign(&mut self, rhs: &Integer)
fn pow_assign(&mut self, rhs: &Integer)
source§impl PowAssign<&f32> for Complex
impl PowAssign<&f32> for Complex
source§fn pow_assign(&mut self, rhs: &f32)
fn pow_assign(&mut self, rhs: &f32)
source§impl PowAssign<&f64> for Complex
impl PowAssign<&f64> for Complex
source§fn pow_assign(&mut self, rhs: &f64)
fn pow_assign(&mut self, rhs: &f64)
source§impl PowAssign<&i128> for Complex
impl PowAssign<&i128> for Complex
source§fn pow_assign(&mut self, rhs: &i128)
fn pow_assign(&mut self, rhs: &i128)
source§impl PowAssign<&i16> for Complex
impl PowAssign<&i16> for Complex
source§fn pow_assign(&mut self, rhs: &i16)
fn pow_assign(&mut self, rhs: &i16)
source§impl PowAssign<&i32> for Complex
impl PowAssign<&i32> for Complex
source§fn pow_assign(&mut self, rhs: &i32)
fn pow_assign(&mut self, rhs: &i32)
source§impl PowAssign<&i64> for Complex
impl PowAssign<&i64> for Complex
source§fn pow_assign(&mut self, rhs: &i64)
fn pow_assign(&mut self, rhs: &i64)
source§impl PowAssign<&i8> for Complex
impl PowAssign<&i8> for Complex
source§fn pow_assign(&mut self, rhs: &i8)
fn pow_assign(&mut self, rhs: &i8)
source§impl PowAssign<&isize> for Complex
impl PowAssign<&isize> for Complex
source§fn pow_assign(&mut self, rhs: &isize)
fn pow_assign(&mut self, rhs: &isize)
source§impl PowAssign<&u128> for Complex
impl PowAssign<&u128> for Complex
source§fn pow_assign(&mut self, rhs: &u128)
fn pow_assign(&mut self, rhs: &u128)
source§impl PowAssign<&u16> for Complex
impl PowAssign<&u16> for Complex
source§fn pow_assign(&mut self, rhs: &u16)
fn pow_assign(&mut self, rhs: &u16)
source§impl PowAssign<&u32> for Complex
impl PowAssign<&u32> for Complex
source§fn pow_assign(&mut self, rhs: &u32)
fn pow_assign(&mut self, rhs: &u32)
source§impl PowAssign<&u64> for Complex
impl PowAssign<&u64> for Complex
source§fn pow_assign(&mut self, rhs: &u64)
fn pow_assign(&mut self, rhs: &u64)
source§impl PowAssign<&u8> for Complex
impl PowAssign<&u8> for Complex
source§fn pow_assign(&mut self, rhs: &u8)
fn pow_assign(&mut self, rhs: &u8)
source§impl PowAssign<&usize> for Complex
impl PowAssign<&usize> for Complex
source§fn pow_assign(&mut self, rhs: &usize)
fn pow_assign(&mut self, rhs: &usize)
source§impl PowAssign<Complex> for Complex
impl PowAssign<Complex> for Complex
source§fn pow_assign(&mut self, rhs: Complex)
fn pow_assign(&mut self, rhs: Complex)
source§impl PowAssign<Float> for Complex
impl PowAssign<Float> for Complex
source§fn pow_assign(&mut self, rhs: Float)
fn pow_assign(&mut self, rhs: Float)
source§impl PowAssign<Integer> for Complex
impl PowAssign<Integer> for Complex
source§fn pow_assign(&mut self, rhs: Integer)
fn pow_assign(&mut self, rhs: Integer)
source§impl PowAssign<f32> for Complex
impl PowAssign<f32> for Complex
source§fn pow_assign(&mut self, rhs: f32)
fn pow_assign(&mut self, rhs: f32)
source§impl PowAssign<f64> for Complex
impl PowAssign<f64> for Complex
source§fn pow_assign(&mut self, rhs: f64)
fn pow_assign(&mut self, rhs: f64)
source§impl PowAssign<i128> for Complex
impl PowAssign<i128> for Complex
source§fn pow_assign(&mut self, rhs: i128)
fn pow_assign(&mut self, rhs: i128)
source§impl PowAssign<i16> for Complex
impl PowAssign<i16> for Complex
source§fn pow_assign(&mut self, rhs: i16)
fn pow_assign(&mut self, rhs: i16)
source§impl PowAssign<i32> for Complex
impl PowAssign<i32> for Complex
source§fn pow_assign(&mut self, rhs: i32)
fn pow_assign(&mut self, rhs: i32)
source§impl PowAssign<i64> for Complex
impl PowAssign<i64> for Complex
source§fn pow_assign(&mut self, rhs: i64)
fn pow_assign(&mut self, rhs: i64)
source§impl PowAssign<i8> for Complex
impl PowAssign<i8> for Complex
source§fn pow_assign(&mut self, rhs: i8)
fn pow_assign(&mut self, rhs: i8)
source§impl PowAssign<isize> for Complex
impl PowAssign<isize> for Complex
source§fn pow_assign(&mut self, rhs: isize)
fn pow_assign(&mut self, rhs: isize)
source§impl PowAssign<u128> for Complex
impl PowAssign<u128> for Complex
source§fn pow_assign(&mut self, rhs: u128)
fn pow_assign(&mut self, rhs: u128)
source§impl PowAssign<u16> for Complex
impl PowAssign<u16> for Complex
source§fn pow_assign(&mut self, rhs: u16)
fn pow_assign(&mut self, rhs: u16)
source§impl PowAssign<u32> for Complex
impl PowAssign<u32> for Complex
source§fn pow_assign(&mut self, rhs: u32)
fn pow_assign(&mut self, rhs: u32)
source§impl PowAssign<u64> for Complex
impl PowAssign<u64> for Complex
source§fn pow_assign(&mut self, rhs: u64)
fn pow_assign(&mut self, rhs: u64)
source§impl PowAssign<u8> for Complex
impl PowAssign<u8> for Complex
source§fn pow_assign(&mut self, rhs: u8)
fn pow_assign(&mut self, rhs: u8)
source§impl PowAssign<usize> for Complex
impl PowAssign<usize> for Complex
source§fn pow_assign(&mut self, rhs: usize)
fn pow_assign(&mut self, rhs: usize)
source§impl PowAssignRound<&Complex> for Complex
impl PowAssignRound<&Complex> for Complex
source§impl PowAssignRound<&Float> for Complex
impl PowAssignRound<&Float> for Complex
source§impl PowAssignRound<&Integer> for Complex
impl PowAssignRound<&Integer> for Complex
source§impl PowAssignRound<&f32> for Complex
impl PowAssignRound<&f32> for Complex
source§impl PowAssignRound<&f64> for Complex
impl PowAssignRound<&f64> for Complex
source§impl PowAssignRound<&i128> for Complex
impl PowAssignRound<&i128> for Complex
source§impl PowAssignRound<&i16> for Complex
impl PowAssignRound<&i16> for Complex
source§impl PowAssignRound<&i32> for Complex
impl PowAssignRound<&i32> for Complex
source§impl PowAssignRound<&i64> for Complex
impl PowAssignRound<&i64> for Complex
source§impl PowAssignRound<&i8> for Complex
impl PowAssignRound<&i8> for Complex
source§impl PowAssignRound<&isize> for Complex
impl PowAssignRound<&isize> for Complex
source§impl PowAssignRound<&u128> for Complex
impl PowAssignRound<&u128> for Complex
source§impl PowAssignRound<&u16> for Complex
impl PowAssignRound<&u16> for Complex
source§impl PowAssignRound<&u32> for Complex
impl PowAssignRound<&u32> for Complex
source§impl PowAssignRound<&u64> for Complex
impl PowAssignRound<&u64> for Complex
source§impl PowAssignRound<&u8> for Complex
impl PowAssignRound<&u8> for Complex
source§impl PowAssignRound<&usize> for Complex
impl PowAssignRound<&usize> for Complex
source§impl PowAssignRound<Float> for Complex
impl PowAssignRound<Float> for Complex
source§impl PowAssignRound<Integer> for Complex
impl PowAssignRound<Integer> for Complex
source§impl PowAssignRound<f32> for Complex
impl PowAssignRound<f32> for Complex
source§impl PowAssignRound<f64> for Complex
impl PowAssignRound<f64> for Complex
source§impl PowAssignRound<i128> for Complex
impl PowAssignRound<i128> for Complex
source§impl PowAssignRound<i16> for Complex
impl PowAssignRound<i16> for Complex
source§impl PowAssignRound<i32> for Complex
impl PowAssignRound<i32> for Complex
source§impl PowAssignRound<i64> for Complex
impl PowAssignRound<i64> for Complex
source§impl PowAssignRound<i8> for Complex
impl PowAssignRound<i8> for Complex
source§impl PowAssignRound<isize> for Complex
impl PowAssignRound<isize> for Complex
source§impl PowAssignRound<u128> for Complex
impl PowAssignRound<u128> for Complex
source§impl PowAssignRound<u16> for Complex
impl PowAssignRound<u16> for Complex
source§impl PowAssignRound<u32> for Complex
impl PowAssignRound<u32> for Complex
source§impl PowAssignRound<u64> for Complex
impl PowAssignRound<u64> for Complex
source§impl PowAssignRound<u8> for Complex
impl PowAssignRound<u8> for Complex
source§impl PowAssignRound<usize> for Complex
impl PowAssignRound<usize> for Complex
source§impl PowAssignRound for Complex
impl PowAssignRound for Complex
source§impl PowFromRound<&Complex> for Complex
impl PowFromRound<&Complex> for Complex
source§impl PowFromRound<&f32> for Complex
impl PowFromRound<&f32> for Complex
source§impl PowFromRound<&f64> for Complex
impl PowFromRound<&f64> for Complex
source§impl PowFromRound<&i128> for Complex
impl PowFromRound<&i128> for Complex
source§impl PowFromRound<&i16> for Complex
impl PowFromRound<&i16> for Complex
source§impl PowFromRound<&i32> for Complex
impl PowFromRound<&i32> for Complex
source§impl PowFromRound<&i64> for Complex
impl PowFromRound<&i64> for Complex
source§impl PowFromRound<&i8> for Complex
impl PowFromRound<&i8> for Complex
source§impl PowFromRound<&isize> for Complex
impl PowFromRound<&isize> for Complex
source§impl PowFromRound<&u128> for Complex
impl PowFromRound<&u128> for Complex
source§impl PowFromRound<&u16> for Complex
impl PowFromRound<&u16> for Complex
source§impl PowFromRound<&u32> for Complex
impl PowFromRound<&u32> for Complex
source§impl PowFromRound<&u64> for Complex
impl PowFromRound<&u64> for Complex
source§impl PowFromRound<&u8> for Complex
impl PowFromRound<&u8> for Complex
source§impl PowFromRound<&usize> for Complex
impl PowFromRound<&usize> for Complex
source§impl PowFromRound<f32> for Complex
impl PowFromRound<f32> for Complex
source§impl PowFromRound<f64> for Complex
impl PowFromRound<f64> for Complex
source§impl PowFromRound<i128> for Complex
impl PowFromRound<i128> for Complex
source§impl PowFromRound<i16> for Complex
impl PowFromRound<i16> for Complex
source§impl PowFromRound<i32> for Complex
impl PowFromRound<i32> for Complex
source§impl PowFromRound<i64> for Complex
impl PowFromRound<i64> for Complex
source§impl PowFromRound<i8> for Complex
impl PowFromRound<i8> for Complex
source§impl PowFromRound<isize> for Complex
impl PowFromRound<isize> for Complex
source§impl PowFromRound<u128> for Complex
impl PowFromRound<u128> for Complex
source§impl PowFromRound<u16> for Complex
impl PowFromRound<u16> for Complex
source§impl PowFromRound<u32> for Complex
impl PowFromRound<u32> for Complex
source§impl PowFromRound<u64> for Complex
impl PowFromRound<u64> for Complex
source§impl PowFromRound<u8> for Complex
impl PowFromRound<u8> for Complex
source§impl PowFromRound<usize> for Complex
impl PowFromRound<usize> for Complex
source§impl PowFromRound for Complex
impl PowFromRound for Complex
source§impl ShlAssign<&i32> for Complex
impl ShlAssign<&i32> for Complex
source§fn shl_assign(&mut self, rhs: &i32)
fn shl_assign(&mut self, rhs: &i32)
<<=
operation. Read moresource§impl ShlAssign<&isize> for Complex
impl ShlAssign<&isize> for Complex
source§fn shl_assign(&mut self, rhs: &isize)
fn shl_assign(&mut self, rhs: &isize)
<<=
operation. Read moresource§impl ShlAssign<&u32> for Complex
impl ShlAssign<&u32> for Complex
source§fn shl_assign(&mut self, rhs: &u32)
fn shl_assign(&mut self, rhs: &u32)
<<=
operation. Read moresource§impl ShlAssign<&usize> for Complex
impl ShlAssign<&usize> for Complex
source§fn shl_assign(&mut self, rhs: &usize)
fn shl_assign(&mut self, rhs: &usize)
<<=
operation. Read moresource§impl ShlAssign<i32> for Complex
impl ShlAssign<i32> for Complex
source§fn shl_assign(&mut self, rhs: i32)
fn shl_assign(&mut self, rhs: i32)
<<=
operation. Read moresource§impl ShlAssign<isize> for Complex
impl ShlAssign<isize> for Complex
source§fn shl_assign(&mut self, rhs: isize)
fn shl_assign(&mut self, rhs: isize)
<<=
operation. Read moresource§impl ShlAssign<u32> for Complex
impl ShlAssign<u32> for Complex
source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
<<=
operation. Read moresource§impl ShlAssign<usize> for Complex
impl ShlAssign<usize> for Complex
source§fn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
<<=
operation. Read moresource§impl ShrAssign<&i32> for Complex
impl ShrAssign<&i32> for Complex
source§fn shr_assign(&mut self, rhs: &i32)
fn shr_assign(&mut self, rhs: &i32)
>>=
operation. Read moresource§impl ShrAssign<&isize> for Complex
impl ShrAssign<&isize> for Complex
source§fn shr_assign(&mut self, rhs: &isize)
fn shr_assign(&mut self, rhs: &isize)
>>=
operation. Read moresource§impl ShrAssign<&u32> for Complex
impl ShrAssign<&u32> for Complex
source§fn shr_assign(&mut self, rhs: &u32)
fn shr_assign(&mut self, rhs: &u32)
>>=
operation. Read moresource§impl ShrAssign<&usize> for Complex
impl ShrAssign<&usize> for Complex
source§fn shr_assign(&mut self, rhs: &usize)
fn shr_assign(&mut self, rhs: &usize)
>>=
operation. Read moresource§impl ShrAssign<i32> for Complex
impl ShrAssign<i32> for Complex
source§fn shr_assign(&mut self, rhs: i32)
fn shr_assign(&mut self, rhs: i32)
>>=
operation. Read moresource§impl ShrAssign<isize> for Complex
impl ShrAssign<isize> for Complex
source§fn shr_assign(&mut self, rhs: isize)
fn shr_assign(&mut self, rhs: isize)
>>=
operation. Read moresource§impl ShrAssign<u32> for Complex
impl ShrAssign<u32> for Complex
source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
>>=
operation. Read moresource§impl ShrAssign<usize> for Complex
impl ShrAssign<usize> for Complex
source§fn shr_assign(&mut self, rhs: usize)
fn shr_assign(&mut self, rhs: usize)
>>=
operation. Read moresource§impl SubAssign<&Complex> for Complex
impl SubAssign<&Complex> for Complex
source§fn sub_assign(&mut self, rhs: &Complex)
fn sub_assign(&mut self, rhs: &Complex)
-=
operation. Read moresource§impl SubAssign<&Float> for Complex
impl SubAssign<&Float> for Complex
source§fn sub_assign(&mut self, rhs: &Float)
fn sub_assign(&mut self, rhs: &Float)
-=
operation. Read moresource§impl SubAssign<&Integer> for Complex
impl SubAssign<&Integer> for Complex
source§fn sub_assign(&mut self, rhs: &Integer)
fn sub_assign(&mut self, rhs: &Integer)
-=
operation. Read moresource§impl SubAssign<&Rational> for Complex
impl SubAssign<&Rational> for Complex
source§fn sub_assign(&mut self, rhs: &Rational)
fn sub_assign(&mut self, rhs: &Rational)
-=
operation. Read moresource§impl SubAssign<&f32> for Complex
impl SubAssign<&f32> for Complex
source§fn sub_assign(&mut self, rhs: &f32)
fn sub_assign(&mut self, rhs: &f32)
-=
operation. Read moresource§impl SubAssign<&f64> for Complex
impl SubAssign<&f64> for Complex
source§fn sub_assign(&mut self, rhs: &f64)
fn sub_assign(&mut self, rhs: &f64)
-=
operation. Read moresource§impl SubAssign<&i128> for Complex
impl SubAssign<&i128> for Complex
source§fn sub_assign(&mut self, rhs: &i128)
fn sub_assign(&mut self, rhs: &i128)
-=
operation. Read moresource§impl SubAssign<&i16> for Complex
impl SubAssign<&i16> for Complex
source§fn sub_assign(&mut self, rhs: &i16)
fn sub_assign(&mut self, rhs: &i16)
-=
operation. Read moresource§impl SubAssign<&i32> for Complex
impl SubAssign<&i32> for Complex
source§fn sub_assign(&mut self, rhs: &i32)
fn sub_assign(&mut self, rhs: &i32)
-=
operation. Read moresource§impl SubAssign<&i64> for Complex
impl SubAssign<&i64> for Complex
source§fn sub_assign(&mut self, rhs: &i64)
fn sub_assign(&mut self, rhs: &i64)
-=
operation. Read moresource§impl SubAssign<&i8> for Complex
impl SubAssign<&i8> for Complex
source§fn sub_assign(&mut self, rhs: &i8)
fn sub_assign(&mut self, rhs: &i8)
-=
operation. Read moresource§impl SubAssign<&isize> for Complex
impl SubAssign<&isize> for Complex
source§fn sub_assign(&mut self, rhs: &isize)
fn sub_assign(&mut self, rhs: &isize)
-=
operation. Read moresource§impl SubAssign<&u128> for Complex
impl SubAssign<&u128> for Complex
source§fn sub_assign(&mut self, rhs: &u128)
fn sub_assign(&mut self, rhs: &u128)
-=
operation. Read moresource§impl SubAssign<&u16> for Complex
impl SubAssign<&u16> for Complex
source§fn sub_assign(&mut self, rhs: &u16)
fn sub_assign(&mut self, rhs: &u16)
-=
operation. Read moresource§impl SubAssign<&u32> for Complex
impl SubAssign<&u32> for Complex
source§fn sub_assign(&mut self, rhs: &u32)
fn sub_assign(&mut self, rhs: &u32)
-=
operation. Read moresource§impl SubAssign<&u64> for Complex
impl SubAssign<&u64> for Complex
source§fn sub_assign(&mut self, rhs: &u64)
fn sub_assign(&mut self, rhs: &u64)
-=
operation. Read moresource§impl SubAssign<&u8> for Complex
impl SubAssign<&u8> for Complex
source§fn sub_assign(&mut self, rhs: &u8)
fn sub_assign(&mut self, rhs: &u8)
-=
operation. Read moresource§impl SubAssign<&usize> for Complex
impl SubAssign<&usize> for Complex
source§fn sub_assign(&mut self, rhs: &usize)
fn sub_assign(&mut self, rhs: &usize)
-=
operation. Read moresource§impl SubAssign<Float> for Complex
impl SubAssign<Float> for Complex
source§fn sub_assign(&mut self, rhs: Float)
fn sub_assign(&mut self, rhs: Float)
-=
operation. Read moresource§impl SubAssign<Integer> for Complex
impl SubAssign<Integer> for Complex
source§fn sub_assign(&mut self, rhs: Integer)
fn sub_assign(&mut self, rhs: Integer)
-=
operation. Read moresource§impl SubAssign<Rational> for Complex
impl SubAssign<Rational> for Complex
source§fn sub_assign(&mut self, rhs: Rational)
fn sub_assign(&mut self, rhs: Rational)
-=
operation. Read moresource§impl SubAssign<f32> for Complex
impl SubAssign<f32> for Complex
source§fn sub_assign(&mut self, rhs: f32)
fn sub_assign(&mut self, rhs: f32)
-=
operation. Read moresource§impl SubAssign<f64> for Complex
impl SubAssign<f64> for Complex
source§fn sub_assign(&mut self, rhs: f64)
fn sub_assign(&mut self, rhs: f64)
-=
operation. Read moresource§impl SubAssign<i128> for Complex
impl SubAssign<i128> for Complex
source§fn sub_assign(&mut self, rhs: i128)
fn sub_assign(&mut self, rhs: i128)
-=
operation. Read moresource§impl SubAssign<i16> for Complex
impl SubAssign<i16> for Complex
source§fn sub_assign(&mut self, rhs: i16)
fn sub_assign(&mut self, rhs: i16)
-=
operation. Read moresource§impl SubAssign<i32> for Complex
impl SubAssign<i32> for Complex
source§fn sub_assign(&mut self, rhs: i32)
fn sub_assign(&mut self, rhs: i32)
-=
operation. Read moresource§impl SubAssign<i64> for Complex
impl SubAssign<i64> for Complex
source§fn sub_assign(&mut self, rhs: i64)
fn sub_assign(&mut self, rhs: i64)
-=
operation. Read moresource§impl SubAssign<i8> for Complex
impl SubAssign<i8> for Complex
source§fn sub_assign(&mut self, rhs: i8)
fn sub_assign(&mut self, rhs: i8)
-=
operation. Read moresource§impl SubAssign<isize> for Complex
impl SubAssign<isize> for Complex
source§fn sub_assign(&mut self, rhs: isize)
fn sub_assign(&mut self, rhs: isize)
-=
operation. Read moresource§impl SubAssign<u128> for Complex
impl SubAssign<u128> for Complex
source§fn sub_assign(&mut self, rhs: u128)
fn sub_assign(&mut self, rhs: u128)
-=
operation. Read moresource§impl SubAssign<u16> for Complex
impl SubAssign<u16> for Complex
source§fn sub_assign(&mut self, rhs: u16)
fn sub_assign(&mut self, rhs: u16)
-=
operation. Read moresource§impl SubAssign<u32> for Complex
impl SubAssign<u32> for Complex
source§fn sub_assign(&mut self, rhs: u32)
fn sub_assign(&mut self, rhs: u32)
-=
operation. Read moresource§impl SubAssign<u64> for Complex
impl SubAssign<u64> for Complex
source§fn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
-=
operation. Read moresource§impl SubAssign<u8> for Complex
impl SubAssign<u8> for Complex
source§fn sub_assign(&mut self, rhs: u8)
fn sub_assign(&mut self, rhs: u8)
-=
operation. Read moresource§impl SubAssign<usize> for Complex
impl SubAssign<usize> for Complex
source§fn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
-=
operation. Read moresource§impl SubAssign for Complex
impl SubAssign for Complex
source§fn sub_assign(&mut self, rhs: Complex)
fn sub_assign(&mut self, rhs: Complex)
-=
operation. Read moresource§impl SubAssignRound<&Complex> for Complex
impl SubAssignRound<&Complex> for Complex
source§impl SubAssignRound<&Float> for Complex
impl SubAssignRound<&Float> for Complex
source§impl SubAssignRound<&Integer> for Complex
impl SubAssignRound<&Integer> for Complex
source§impl SubAssignRound<&Rational> for Complex
impl SubAssignRound<&Rational> for Complex
source§impl SubAssignRound<&f32> for Complex
impl SubAssignRound<&f32> for Complex
source§impl SubAssignRound<&f64> for Complex
impl SubAssignRound<&f64> for Complex
source§impl SubAssignRound<&i128> for Complex
impl SubAssignRound<&i128> for Complex
source§impl SubAssignRound<&i16> for Complex
impl SubAssignRound<&i16> for Complex
source§impl SubAssignRound<&i32> for Complex
impl SubAssignRound<&i32> for Complex
source§impl SubAssignRound<&i64> for Complex
impl SubAssignRound<&i64> for Complex
source§impl SubAssignRound<&i8> for Complex
impl SubAssignRound<&i8> for Complex
source§impl SubAssignRound<&isize> for Complex
impl SubAssignRound<&isize> for Complex
source§impl SubAssignRound<&u128> for Complex
impl SubAssignRound<&u128> for Complex
source§impl SubAssignRound<&u16> for Complex
impl SubAssignRound<&u16> for Complex
source§impl SubAssignRound<&u32> for Complex
impl SubAssignRound<&u32> for Complex
source§impl SubAssignRound<&u64> for Complex
impl SubAssignRound<&u64> for Complex
source§impl SubAssignRound<&u8> for Complex
impl SubAssignRound<&u8> for Complex
source§impl SubAssignRound<&usize> for Complex
impl SubAssignRound<&usize> for Complex
source§impl SubAssignRound<Float> for Complex
impl SubAssignRound<Float> for Complex
source§impl SubAssignRound<Integer> for Complex
impl SubAssignRound<Integer> for Complex
source§impl SubAssignRound<Rational> for Complex
impl SubAssignRound<Rational> for Complex
source§impl SubAssignRound<f32> for Complex
impl SubAssignRound<f32> for Complex
source§impl SubAssignRound<f64> for Complex
impl SubAssignRound<f64> for Complex
source§impl SubAssignRound<i128> for Complex
impl SubAssignRound<i128> for Complex
source§impl SubAssignRound<i16> for Complex
impl SubAssignRound<i16> for Complex
source§impl SubAssignRound<i32> for Complex
impl SubAssignRound<i32> for Complex
source§impl SubAssignRound<i64> for Complex
impl SubAssignRound<i64> for Complex
source§impl SubAssignRound<i8> for Complex
impl SubAssignRound<i8> for Complex
source§impl SubAssignRound<isize> for Complex
impl SubAssignRound<isize> for Complex
source§impl SubAssignRound<u128> for Complex
impl SubAssignRound<u128> for Complex
source§impl SubAssignRound<u16> for Complex
impl SubAssignRound<u16> for Complex
source§impl SubAssignRound<u32> for Complex
impl SubAssignRound<u32> for Complex
source§impl SubAssignRound<u64> for Complex
impl SubAssignRound<u64> for Complex
source§impl SubAssignRound<u8> for Complex
impl SubAssignRound<u8> for Complex
source§impl SubAssignRound<usize> for Complex
impl SubAssignRound<usize> for Complex
source§impl SubAssignRound for Complex
impl SubAssignRound for Complex
source§impl SubFromRound<&Complex> for Complex
impl SubFromRound<&Complex> for Complex
source§impl SubFromRound<&Float> for Complex
impl SubFromRound<&Float> for Complex
source§impl SubFromRound<&Integer> for Complex
impl SubFromRound<&Integer> for Complex
source§impl SubFromRound<&Rational> for Complex
impl SubFromRound<&Rational> for Complex
source§impl SubFromRound<&f32> for Complex
impl SubFromRound<&f32> for Complex
source§impl SubFromRound<&f64> for Complex
impl SubFromRound<&f64> for Complex
source§impl SubFromRound<&i128> for Complex
impl SubFromRound<&i128> for Complex
source§impl SubFromRound<&i16> for Complex
impl SubFromRound<&i16> for Complex
source§impl SubFromRound<&i32> for Complex
impl SubFromRound<&i32> for Complex
source§impl SubFromRound<&i64> for Complex
impl SubFromRound<&i64> for Complex
source§impl SubFromRound<&i8> for Complex
impl SubFromRound<&i8> for Complex
source§impl SubFromRound<&isize> for Complex
impl SubFromRound<&isize> for Complex
source§impl SubFromRound<&u128> for Complex
impl SubFromRound<&u128> for Complex
source§impl SubFromRound<&u16> for Complex
impl SubFromRound<&u16> for Complex
source§impl SubFromRound<&u32> for Complex
impl SubFromRound<&u32> for Complex
source§impl SubFromRound<&u64> for Complex
impl SubFromRound<&u64> for Complex
source§impl SubFromRound<&u8> for Complex
impl SubFromRound<&u8> for Complex
source§impl SubFromRound<&usize> for Complex
impl SubFromRound<&usize> for Complex
source§impl SubFromRound<Float> for Complex
impl SubFromRound<Float> for Complex
source§impl SubFromRound<Integer> for Complex
impl SubFromRound<Integer> for Complex
source§impl SubFromRound<Rational> for Complex
impl SubFromRound<Rational> for Complex
source§impl SubFromRound<f32> for Complex
impl SubFromRound<f32> for Complex
source§impl SubFromRound<f64> for Complex
impl SubFromRound<f64> for Complex
source§impl SubFromRound<i128> for Complex
impl SubFromRound<i128> for Complex
source§impl SubFromRound<i16> for Complex
impl SubFromRound<i16> for Complex
source§impl SubFromRound<i32> for Complex
impl SubFromRound<i32> for Complex
source§impl SubFromRound<i64> for Complex
impl SubFromRound<i64> for Complex
source§impl SubFromRound<i8> for Complex
impl SubFromRound<i8> for Complex
source§impl SubFromRound<isize> for Complex
impl SubFromRound<isize> for Complex
source§impl SubFromRound<u128> for Complex
impl SubFromRound<u128> for Complex
source§impl SubFromRound<u16> for Complex
impl SubFromRound<u16> for Complex
source§impl SubFromRound<u32> for Complex
impl SubFromRound<u32> for Complex
source§impl SubFromRound<u64> for Complex
impl SubFromRound<u64> for Complex
source§impl SubFromRound<u8> for Complex
impl SubFromRound<u8> for Complex
source§impl SubFromRound<usize> for Complex
impl SubFromRound<usize> for Complex
source§impl SubFromRound for Complex
impl SubFromRound for Complex
impl Send for Complex
impl Sync for Complex
Auto Trait Implementations§
impl Freeze for Complex
impl RefUnwindSafe 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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)