Type::Complex -- a type and a
property representing complex numbers
IntroductionType::Complex represents complex numbers. This type can
also be used as a property to
mark identifiers as complex numbers.
Call(s)testtype(obj, Type::Complex)
assume(x, Type::Complex)
is(ex, Type::Complex)
Parametersobj |
- | any MuPAD object |
x |
- | an identifier |
ex |
- | an arithmetical expression |
Returns
Related
Functionsassume, is, testtype, Type::Imaginary, Type::Property, Type::Real
Detailstesttype(obj, Type::Complex)
checks, whether obj is a complex number and returns
TRUE, if it holds,
otherwise FALSE.testtype only
performs a syntactical test identifying MuPAD objects of type
DOM_INT, DOM_RAT, DOM_FLOAT and DOM_COMPLEX. This does not
include arithmetical expressions such as exp(1), which are
not identified as of type Type::Complex.assume(x,
Type::Complex) marks the identifier x as a complex number.
The call is(ex,
Type::Complex) derives, whether the expression ex is a
complex number (or this property can be derived).
assume and is.
Example
1The following numbers are of type
Type::Complex:
>> testtype(2, Type::Complex), testtype(3/4, Type::Complex), testtype(0.123, Type::Complex), testtype(1 + I/3, Type::Complex), testtype(1.0 + 2.0*I, Type::Complex)
TRUE, TRUE, TRUE, TRUE, TRUE
The following expressions are exact representations of
complex numbers. Syntactically, however, they are not of type
Type::Complex:
>> testtype(exp(3), Type::Complex), testtype(PI^2 + 5, Type::Complex), testtype(sin(2) + PI*I, Type::Complex)
FALSE, FALSE, FALSE
Example
2Identifiers may be assumed to represent a complex number:
>> assume(x, Type::Complex): is(x, Type::Complex)
TRUE
The real numbers are a subset of the complex numbers:
>> assume(x, Type::Real): is(x, Type::Complex)
TRUE
Without further information, it cannot be decided whether a complex number is real:
>> assume(x, Type::Complex): is(x, Type::Real)
UNKNOWN
>> unassume(x):