Skip to main content

complex32

Macro complex32 

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

Creates a validated single-precision complex number from two f32 literals (real and imaginary parts).

This macro is the f32 counterpart of complex!: it provides a concise syntax for creating ComplexNative32StrictFinite values from two single-precision floating-point literals.

§Panics

Panics if either the real or imaginary part is not finite (NaN, infinity) or is subnormal. For fallible conversion, use ComplexNative32StrictFinite::try_new_complex directly.

§Examples

use num_valid::complex32;

let z1 = complex32!(1.0, 2.0);   // 1 + 2i
let z2 = complex32!(-3.0, 4.0);  // -3 + 4i