# Trait num_complex::ComplexFloat

``````pub trait ComplexFloat: Num + NumCast + Copy + Neg<Output = Self> + Seal {
type Real: Float + FloatConst;

Show 35 methods    fn is_nan(self) -> bool;
fn is_infinite(self) -> bool;
fn is_finite(self) -> bool;
fn is_normal(self) -> bool;
fn recip(self) -> Self;
fn powi(self, exp: i32) -> Self;
fn powf(self, exp: Self::Real) -> Self;
fn powc(self, exp: Complex<Self::Real>) -> Complex<Self::Real>;
fn sqrt(self) -> Self;
fn exp(self) -> Self;
fn exp2(self) -> Self;
fn expf(self, base: Self::Real) -> Self;
fn ln(self) -> Self;
fn log(self, base: Self::Real) -> Self;
fn log2(self) -> Self;
fn log10(self) -> Self;
fn cbrt(self) -> Self;
fn sin(self) -> Self;
fn cos(self) -> Self;
fn tan(self) -> Self;
fn asin(self) -> Self;
fn acos(self) -> Self;
fn atan(self) -> Self;
fn sinh(self) -> Self;
fn cosh(self) -> Self;
fn tanh(self) -> Self;
fn asinh(self) -> Self;
fn acosh(self) -> Self;
fn atanh(self) -> Self;
fn re(self) -> Self::Real;
fn im(self) -> Self::Real;
fn abs(self) -> Self::Real;
fn l1_norm(&self) -> Self::Real;
fn arg(self) -> Self::Real;
fn conj(self) -> Self;
}``````
Expand description

Generic trait for floating point complex numbers.

This trait defines methods which are common to complex floating point numbers and regular floating point numbers.

This trait is sealed to prevent it from being implemented by anything other than floating point scalars and Complex floats.

## Required Associated Types§

The type used to represent the real coefficients of this complex number.

## Required Methods§

Returns `true` if this value is `NaN` and false otherwise.

Returns `true` if this value is positive infinity or negative infinity and false otherwise.

Returns `true` if this number is neither infinite nor `NaN`.

Returns `true` if the number is neither zero, infinite, subnormal, or `NaN`.

Take the reciprocal (inverse) of a number, `1/x`. See also Complex::finv.

Raises `self` to a signed integer power.

Raises `self` to a real power.

Raises `self` to a complex power.

Take the square root of a number.

Returns `e^(self)`, (the exponential function).

Returns `2^(self)`.

Returns `base^(self)`.

Returns the natural logarithm of the number.

Returns the logarithm of the number with respect to an arbitrary base.

Returns the base 2 logarithm of the number.

Returns the base 10 logarithm of the number.

Take the cubic root of a number.

Computes the sine of a number (in radians).

Computes the cosine of a number (in radians).

Computes the tangent of a number (in radians).

Computes the arcsine of a number. Return value is in radians in the range [-pi/2, pi/2] or NaN if the number is outside the range [-1, 1].

Computes the arccosine of a number. Return value is in radians in the range [0, pi] or NaN if the number is outside the range [-1, 1].

Computes the arctangent of a number. Return value is in radians in the range [-pi/2, pi/2];

Hyperbolic sine function.

Hyperbolic cosine function.

Hyperbolic tangent function.

Inverse hyperbolic sine function.

Inverse hyperbolic cosine function.

Inverse hyperbolic tangent function.

Returns the real part of the number.

Returns the imaginary part of the number.

Returns the L1 norm `|re| + |im|` – the Manhattan distance from the origin.
Formula: `a+bi -> a-bi`