EitherComplex
This class represents a value that can be either a raw pair of 64-bit floating-point numbers representing a complex value or a reference to a Python complex object. It provides a flexible interface for handling complex number data across the Python-Rust boundary.
Attributes
| Attribute | Type | Description |
|---|---|---|
| Complex | [f64; 2] | Stores a complex number as a fixed-size array of two 64-bit floats representing the real and imaginary parts. |
| Py | Bound< 'py, PyComplex > | Holds a reference to a Python complex number object for interoperability with the Python C-API. |
Constructor
Signature
def Complex(
value: [f64; 2]
) - > [EitherComplex](eithercomplex.md?sid=input_return_enums_eithercomplex)
Parameters
| Name | Type | Description |
|---|---|---|
| value | [f64; 2] | A two-element array containing the real and imaginary components of the complex number. |
Signature
def Py(
value: Bound< 'py, PyComplex >
) - > [EitherComplex](eithercomplex.md?sid=input_return_enums_eithercomplex)
Parameters
| Name | Type | Description |
|---|---|---|
| value | Bound< 'py, PyComplex > | A bound reference to a PyComplex object from the Python C-API. |