Data Types

complex

Supported By

Description

The complex data type represents a complex number, a number of the form a+bi where a and b are real numbers and i is the square root of -1.

Notes

The XION Scripting Language Standard states that both real and imaginary parts of the complex type must have the same precision as that of the number type. OpenXION follows this.

A complex can always convert to a string. A complex can convert to a number if its imaginary part is zero, and can convert to an integer if, in addition to its imaginary part being zero, its real part is a mathematical integer in the range of the integer type.

An integer or a number can always convert to a complex with an imaginary part of zero. A string can convert to a complex if it has the correct format.

The format used for the conversion of a complex to a string is determined by the numberFormat property.