Algosim documentation: IsRealType

IsRealType

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

Syntax

Description

IsRealType(X) returns true iff the data type of X is considered a real 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 IsReal function instead. This tests for “mathematical realness” (imaginary part equal to zero) instead of “technical realness” (real data type).

Examples

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

See also