# MathLib.Complex()

## Examples

There are several ways to initialise complex numbers:## Methods

For a list of properties and methods common to all complex numbers please see the documentation page for the`Complex.prototype`

.
- .polar()
- Constructs a complex number out of the absolute value and the argument.
- .toContentMathML()
- Returns a content MathML string representation of the complex field.
- .toLaTeX()
- Returns a LaTeX string representation of the complex field.
- .toMathML()
- Returns a presentation MathML string representation of the complex field.
- .toString()
- Returns a string representation of the complex field.

## Specification

MathLib.Complex accepts two arguments, where the second argument is optional. Any additional arguments will be ignored. The type of both argument should be number.- If either argument is NaN, return
`{re: NaN, im: NaN}`

. - If either argument is infinite, return
`{re: Infinity, im: Infinity}`

. - If no second argument is provided, set it to +0.
- Return
`{re: firstArgument, im: secondArgument}`

.

## Links

- Complex number on Wikipedia