System.VarCmplx.VarComplexCreate

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function VarComplexCreate: Variant;
function VarComplexCreate(const AReal: Double): Variant;
function VarComplexCreate(const AReal, AImaginary: Double): Variant;
function VarComplexCreate(const AText: string): Variant;

C++

extern DELPHI_PACKAGE System::Variant __fastcall VarComplexCreate(void)/* overload */;

Properties

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

Description

Returns a custom Variant that represents a complex number.

Call VarComplexCreate to create a Variant whose value is a complex number.

AReal is the real part of the complex number.

AImaginary is the imaginary part of the complex number.

Using the first three versions of the constructor, omitting AReal or AImaginary results in a real or imaginary part of 0.

Using the last syntax, AText is parsed using the ComplexNumberSymbol and ComplexNumberSymbolBeforeImaginary global variables and, if the string represents a complex value, that becomes the value of the new Variant. If the string can't be parsed into a complex number, VarComplexCreate raises an EConvertError 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