Algosim documentation: IsComplexType

IsComplexType

Tests if the data type of X is considered a complex type.

Syntax

Description

IsComplexType(X) returns true iff the data type of X is considered a complex data type. These include

but exclude

Notes

Notice that X can be of a complex type even if its imaginary part is zero. For example, a complex matrix may just happen to contain entries that all have zero imaginary parts.

Most often, you want to use the IsComplex function instead. This tests for “mathematical complexness” (imaginary part non-zero) instead of “technical complexness” (complex data type).

Examples

L ≔ '(2, π, i, i^2); Q ≔ X ↦ '(IsComplexType(X), IsComplex(X));
L @ Q
(false, false)
(false, false)
(true, true)
(true, false)

See also