From RAD Studio API Documentation
Jump to: navigation, search


function VarAsComplex(const AValue: Variant): Variant;


extern DELPHI_PACKAGE System::Variant __fastcall VarAsComplex(const System::Variant &AValue);


Type Visibility Source Unit Parent
function public
System.VarCmplx System.VarCmplx


Casts an arbitrary Variant so that it is a custom Variant representing a complex number.

VarAsComplex converts the Variant specified by AValue to a custom Variant representing the corresponding complex number. It returns the custom Variant.

If VarAsComplex can't perform the conversion, it raises an EInvalidCast exception.

Complex Variants are custom Variants that represent complex numbers. The Variant type supports direct manipulation using the addition, subtraction, multiplication, division (but not integer division), and negation operators. They have 5 published properties: Real, Imaginary, Radius, Theta, and FixedTheta. They can be cast to and from integer types, floating point types, string types, TDateTime values, and boolean values. In addition, the VarCmplx unit implements a number of global functions for operating on complex Variants.

See Also