Netural MathLanguage Definition and Syntax


The Complex data type represents a Complex number in ordinary math. That is to say that it contains both a real and imaginary component. The imaginary component is defined as a multiple of the square root of -1. For more information on imaginary numbers in math, please see

The Complex data type is not implemented in the current version of NeturalMath. It is planned to be added in v 0.3.3. Please see Roadmap for more details.

Type information

The Complex data type will return the String 'complex' when queried.
:> x = complex(10,3)
:> numType = type(x)
:> print numType


If output, the complex data type will return a string representation of itself
:> x = complex(10,3)
:> print x

10, 3i


This section is not complete


Complex literals are defined as two values wrapped in parentheses separated by a comma. The imaginary value (second value) should be followed by the letter i to indicate that it is an imaginary number. Complex values may also be specified without the real component, by simply following a number with the letter {{i}. Complex values may also be created using the complex function. Each of these examples is shown below.
x = complex(10,3)  // defining a complex value using the complex function
y = (5, 3i) // defining a complex with a real and imaginary components
z = 2i // a complex defined with an imaginary value only (real component is zero)

The variables above will evaluate as such:
:> print x

(10, 3i)
:> print y

(5, 3i)
:> print z

(0, 2i)


Complex values exhibit the following behaviors when converted to other types:


This section is not complete


This section is not complete


This section is not complete


This section is not complete


This section is not complete


This section is not complete


The following System Functions consume the Complex data type:

See Also:

This section is not complete

Last edited Oct 19, 2010 at 12:58 PM by zanethorn, version 7


No comments yet.