Skip to main content

Module complex

Module complex 

Source
Expand description

Complex number primitives suitable as element types of NumericArray and [PackedArray][crate::PackedArray].

Complex64 is byte-layout-compatible with the C ABI’s _Complex double (and thus wolfram_library_link_sys::mcomplex, which re-exports this same type via pub use). Complex32 is the _Complex float analog.

Both types are #[repr(C)] with two interleaved real/imaginary scalar fields, matching WXF’s wire layout for ComplexReal{32,64} array elements.

Structs§

Complex
Generic complex number — pair of identical scalars (re, im) with C-compatible interleaved layout. Use the Complex64 / Complex32 aliases in code; this generic exists so the impl block and layout invariants are written once.

Type Aliases§

Complex32
Single 32-bit complex number — pair of f32 (real, imaginary). Layout matches the WXF ComplexReal32 element wire format. No _Complex float typedef exists in WolframLibrary.h, so this type is wolfram-expr-only.
Complex64
Single 64-bit complex number — pair of f64 (real, imaginary).