Algosim documentation: IsComplex

IsComplex

Tests if a number, vector, or matrix is non-real.

Syntax

Description

If x is a number, vector, or a matrix, IsComplex(x) is true iff x has non-zero imaginary part. This implies that the data type of x is complex.

Notes

Notice that the name of this function is a bit of a misnomer. A more accurate name would be IsNonReal.

Examples

count(compute(√(n + 5)⋅√n⋅√(n − 3), n, −10, 10), IsComplex)
7
IsComplex(eigenvalues(❨❨1, 2, 1❩, ❨6, −1, 0❩, ❨−2, 1, 2❩❩))
false

See also