A complex number library in rust.
This library provides a type complex for floating point numbers which offers various common mathematical operations.
see docs for all available operations.
use complex::Complex;
use complex::Complexf;
fn main() {
// Create two complex numbers.
let complexa : Complexf = Complex::new( 1.0, 3.0 );
let complexb : Complexf = Complex::new( 2.0, 1.0 );
// Can use these types with various operators
// and transformations.
let add = complexa + complexb;
let mul = complexa * complexb;
complexa /= complexb;
let cos = complexa.cos();
// Check docs for all available operations and transformations.
println!("Final: {:?}", cos);
}