Skip to content
fn

complex_for

Dtype complex_for(Dtype real)

The complex type whose lanes match a given real float type.

f32 -> C64, f64 -> C128, and the half formats widen to C64 because there is no half-precision complex. Used by eig to pick an output dtype that loses nothing: an f64 matrix whose eigenvalues came back as C64 would silently shed eight decimal digits, which is the failure this type was added to avoid.