Macro complex

Source
macro_rules! complex {
    () => { ... };
    ($re:expr) => { ... };
    ($re:expr, $im: expr) => { ... };
}
Expand description

A more convenient way to write Complex::new(...).

ยงExamples

use rust_poly::complex;
use num::Complex;

let c1: Complex<f32> = complex!();
let c2 = Complex::new(0.0, 0.0);
let c3 = complex!(1.0f32, 2.0);
let c4 = Complex::new(1.0, 2.0);

assert_eq!(c1, c2);
assert_eq!(c3, c4);
assert_eq!(complex!(4.20), complex!(4.20, 0.0));