[−][src]Trait maths_traits::analysis::real::ComplexSubset
An algebraic stucture that is a subset of the Complex numbers
This trait is both meant as an ensapsulation of the naturals, integers, real numbers, and complex numbers. This way, users can work with a particular set of similar-precision numeric types abstractly similarly to how they would normally.
Associated Types
type Real: Real + ComplexSubset<Natural = Self::Natural, Integer = Self::Integer, Real = Self::Real>
type Natural: Natural + IntegerSubset<Signed = Self::Integer, Unsigned = Self::Natural> + ComplexSubset<Natural = Self::Natural, Integer = Self::Integer, Real = Self::Real>
type Integer: Integer + IntegerSubset<Signed = Self::Integer, Unsigned = Self::Natural> + ComplexSubset<Natural = Self::Natural, Integer = Self::Integer, Real = Self::Real>
Required methods
fn as_real(self) -> Self::Real
Converts self
to a real number, discarding any imaginary component, if complex.
fn as_natural(self) -> Self::Natural
Converts self
to a natural number, truncating when necessary.
fn as_integer(self) -> Self::Integer
Converts self
to an integer, truncating when necessary.
fn floor(self) -> Self
Rounds the real and imaginary components of self
to the closest integer downward
fn ceil(self) -> Self
Rounds the real and imaginary components of self
to the closest integer upward
fn round(self) -> Self
Rounds the real and imaginary components of self
to the closest integer
fn trunc(self) -> Self
Rounds the real and imaginary components of self
by removing the factional parts
fn fract(self) -> Self
Removes the integral parts of the real and imaginary components of self
fn im(self) -> Self
Sets the real component of self
to 0
fn re(self) -> Self
Sets the imaginary component of self
to 0
fn conj(self) -> Self
The complex conjugate of self
Provided methods
fn modulus_sqrd(self) -> Self
The square of the complex absolute value of self
This is computed as self * self.conj()
by default
fn modulus(self) -> Self::Real
The complex absolute value of self
This is computed as the square root of modulus_sqrd by default