pub struct ComplexNumber { /* private fields */ }Expand description
Scheme complex numeric type.
Implementations§
Source§impl ComplexNumber
impl ComplexNumber
pub fn new(re: SimpleNumber, im: SimpleNumber) -> Self
pub fn is_zero(&self) -> bool
pub fn one() -> Self
pub fn i() -> Self
pub fn inexact(&self) -> Self
pub fn exact(&self) -> Self
pub fn to_string(&self, radix: u32, precision: Option<usize>) -> Option<String>
pub fn from_polar(r: SimpleNumber, theta: SimpleNumber) -> Self
pub fn to_polar(&self) -> (SimpleNumber, SimpleNumber)
pub fn magnitude(&self) -> SimpleNumber
pub fn magnitude2(&self) -> SimpleNumber
pub fn sqrt(&self) -> Self
pub fn arg(&self) -> SimpleNumber
pub fn exp(&self) -> Self
pub fn ln(&self) -> Self
pub fn powc(&self, exp: &Self) -> Self
pub fn sin(&self) -> Self
pub fn cos(&self) -> Self
pub fn tan(&self) -> Self
pub fn asin(&self) -> Self
pub fn acos(&self) -> Self
pub fn atan(&self) -> Self
Trait Implementations§
Source§impl Add<&ComplexNumber> for &ComplexNumber
impl Add<&ComplexNumber> for &ComplexNumber
Source§type Output = ComplexNumber
type Output = ComplexNumber
The resulting type after applying the
+ operator.Source§fn add(self, rhs: &ComplexNumber) -> ComplexNumber
fn add(self, rhs: &ComplexNumber) -> ComplexNumber
Performs the
+ operation. Read moreSource§impl Add for ComplexNumber
impl Add for ComplexNumber
Source§type Output = ComplexNumber
type Output = ComplexNumber
The resulting type after applying the
+ operator.Source§fn add(self, rhs: ComplexNumber) -> ComplexNumber
fn add(self, rhs: ComplexNumber) -> ComplexNumber
Performs the
+ operation. Read moreSource§impl Clone for ComplexNumber
impl Clone for ComplexNumber
Source§fn clone(&self) -> ComplexNumber
fn clone(&self) -> ComplexNumber
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComplexNumber
impl Debug for ComplexNumber
Source§impl Display for ComplexNumber
impl Display for ComplexNumber
Source§impl Div for &ComplexNumber
impl Div for &ComplexNumber
Source§type Output = ComplexNumber
type Output = ComplexNumber
The resulting type after applying the
/ operator.Source§fn div(self, rhs: &ComplexNumber) -> ComplexNumber
fn div(self, rhs: &ComplexNumber) -> ComplexNumber
Performs the
/ operation. Read moreSource§impl Div for ComplexNumber
impl Div for ComplexNumber
Source§type Output = ComplexNumber
type Output = ComplexNumber
The resulting type after applying the
/ operator.Source§fn div(self, rhs: ComplexNumber) -> ComplexNumber
fn div(self, rhs: ComplexNumber) -> ComplexNumber
Performs the
/ operation. Read moreSource§impl From<ComplexNumber> for Number
impl From<ComplexNumber> for Number
Source§fn from(complex: ComplexNumber) -> Self
fn from(complex: ComplexNumber) -> Self
Converts to this type from the input type.
Source§impl From<ComplexNumber> for Value
impl From<ComplexNumber> for Value
Source§fn from(n: ComplexNumber) -> Self
fn from(n: ComplexNumber) -> Self
Converts to this type from the input type.
Source§impl From<SimpleNumber> for ComplexNumber
impl From<SimpleNumber> for ComplexNumber
Source§fn from(value: SimpleNumber) -> Self
fn from(value: SimpleNumber) -> Self
Converts to this type from the input type.
Source§impl Mul<&ComplexNumber> for &ComplexNumber
impl Mul<&ComplexNumber> for &ComplexNumber
Source§type Output = ComplexNumber
type Output = ComplexNumber
The resulting type after applying the
* operator.Source§fn mul(self, rhs: &ComplexNumber) -> ComplexNumber
fn mul(self, rhs: &ComplexNumber) -> ComplexNumber
Performs the
* operation. Read moreSource§impl Mul for ComplexNumber
impl Mul for ComplexNumber
Source§type Output = ComplexNumber
type Output = ComplexNumber
The resulting type after applying the
* operator.Source§fn mul(self, rhs: ComplexNumber) -> ComplexNumber
fn mul(self, rhs: ComplexNumber) -> ComplexNumber
Performs the
* operation. Read moreSource§impl Neg for &ComplexNumber
impl Neg for &ComplexNumber
Source§type Output = ComplexNumber
type Output = ComplexNumber
The resulting type after applying the
- operator.Source§fn neg(self) -> ComplexNumber
fn neg(self) -> ComplexNumber
Performs the unary
- operation. Read moreSource§impl Neg for ComplexNumber
impl Neg for ComplexNumber
Source§type Output = ComplexNumber
type Output = ComplexNumber
The resulting type after applying the
- operator.Source§fn neg(self) -> ComplexNumber
fn neg(self) -> ComplexNumber
Performs the unary
- operation. Read moreSource§impl PartialEq for ComplexNumber
impl PartialEq for ComplexNumber
Source§impl Sub<&ComplexNumber> for &ComplexNumber
impl Sub<&ComplexNumber> for &ComplexNumber
Source§type Output = ComplexNumber
type Output = ComplexNumber
The resulting type after applying the
- operator.Source§fn sub(self, rhs: &ComplexNumber) -> ComplexNumber
fn sub(self, rhs: &ComplexNumber) -> ComplexNumber
Performs the
- operation. Read moreSource§impl Sub for ComplexNumber
impl Sub for ComplexNumber
Source§type Output = ComplexNumber
type Output = ComplexNumber
The resulting type after applying the
- operator.Source§fn sub(self, rhs: ComplexNumber) -> ComplexNumber
fn sub(self, rhs: ComplexNumber) -> ComplexNumber
Performs the
- operation. Read moreSource§impl TryFrom<&Number> for ComplexNumber
impl TryFrom<&Number> for ComplexNumber
Source§impl TryFrom<&Value> for ComplexNumber
impl TryFrom<&Value> for ComplexNumber
Source§impl TryFrom<Number> for ComplexNumber
impl TryFrom<Number> for ComplexNumber
Auto Trait Implementations§
impl Freeze for ComplexNumber
impl RefUnwindSafe for ComplexNumber
impl Send for ComplexNumber
impl Sync for ComplexNumber
impl Unpin for ComplexNumber
impl UnwindSafe for ComplexNumber
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more