Data Types

number

Supported By

Description

The number data type represents a real number. The number data type can also represent the values positive infinity, negative infinity, and NaN.

Notes

The XION Scripting Language Standard states that the number type must have IEEE single precision or better. The number type in OpenXION has arbitrary precision: basic arithmetic operations use the number of fractional digits specified by the precision property, and mathematical functions can use either IEEE double precision or the number of fractional digits specified by the precision property, depending on the setting of the mathProcessor property.

A number can always convert to a string or a complex. A number can convert to an integer only if its numeric value is a mathematical integer and it is within the range of the integer type.

An integer can always convert to a number. A string can convert to a number if it has the correct format, and a complex can convert to a number if its imaginary part is zero.

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