Notkun

Dæmi

Táknmynd fyrir athugasemd

A complex number is a string expression resulting in the form "a+bi" or "a+bj", where a and b are numbers.


Táknmynd fyrir athugasemd

If the complex number is actually a real number (b=0), then it can be either a string expression or a number value.


Táknmynd fyrir aðvörun

The function always returns a string representing a complex number.


Táknmynd fyrir aðvörun

If the result is a complex number with one of its parts (a or b) equal to zero, that part is not displayed.


The imaginary part is equal to zero, so it is not displayed in the result.

The result is presented in the string format and has the character "i" or "j" as an imaginary unit.