Function num_complex::c32
source · pub fn c32<T: Into<f32>>(re: T, im: T) -> Complex32
Expand description
Create a new Complex<f32>
with arguments that can convert Into<f32>
.
use num_complex::{c32, Complex32};
assert_eq!(c32(1u8, 2), Complex32::new(1.0, 2.0));
Note: ambiguous integer literals in Rust will default to i32
, which does not implement
Into<f32>
, so a call like c32(1, 2)
will result in a type error. The example above uses a
suffixed 1u8
to set its type, and then the 2
can be inferred as the same type.