Skip to main content

Module complex

Module complex 

Source
Expand description

Generic complex numbers re + im·i.

Complex is parameterized over the component type, so it composes with any of the crate’s numeric types that expose the relevant operators: Complex<Int> (Gaussian integers), Complex<Rational>, Complex<Dyadic>, Complex<Decimal>, and Complex<FixedFloat>. (The precision-carrying Float has no plain operators, so use FixedFloat for complex floats.)

Addition, subtraction, multiplication, negation, and conjugation need only + - * on the component type; complex division additionally needs /, so it is available for field-like components (Rational, Decimal, FixedFloat) but not for Int.

Structs§

Complex
A complex number with components of type T: re + im·i.