HyperMath

Complex Data Types

Complex Data Types

Previous topic Next topic No expanding text in this topic  

Complex Data Types

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Complex data types are supported in HyperMath.  The letter ‘i’ is used to denote the imaginary part.

> x = 1+2i; print(x)

1+2i

Elementary arithmetic operations are supported on complex data types.

> y = 1 + 2i; print(x+y)

2+4i

> print(x*y)

-3+4i

Complex and non-complex types can be mixed as well.

> print(x + 9)

10 + 2i