Type::Imaginary
-- a type and
a property representing imaginary numbersType::Imaginary
represents complex numbers with
vanishing real part. This type can also be used as a property to mark identifiers as
imaginary numbers.
testtype(obj,
Type::Imaginary)
assume(x,
Type::Imaginary)
is(ex,
Type::Imaginary)
obj |
- | any MuPAD object |
x |
- | an identifier |
ex |
- | an arithmetical expression |
obj |
- | any MuPAD object |
assume
, is
, testtype
, Type::Complex
, Type::Property
testtype(obj,
Type::Imaginary)
checks, whether obj
is an imaginary number (or zero) and
returns TRUE
, if it
holds, otherwise FALSE
.testtype
only
performs a syntactical test identifying MuPAD objects of type
DOM_COMPLEX
and
checks, whether iszero(Re(obj))
holds, or whether
iszero(obj)
is TRUE
. This does not include
arithmetical expressions such as I*exp(1)
, which are not
identified as of type Type::Imaginary
.assume(x,
Type::Imaginary) marks the identifier x
as an imaginary
number.
The call is(ex,
Type::Imaginary) derives, whether the expression ex
is an
imaginary number (or this property can be derived).
assume
and is
.assume(Re(x) =
0)
has the same meaning as assume(x,
Type::Imaginary).The following numbers are of type
Type::Imaginary
:
>> testtype(5*I, Type::Imaginary), testtype(3/2*I, Type::Imaginary), testtype(-1.23*I, Type::Imaginary)
TRUE, TRUE, TRUE
The following expressions are exact representations of
imaginary numbers. However, syntactically they are not of type
Type::Imaginary
, because their domain type is not DOM_COMPLEX
:
>> testtype(exp(3)*I, Type::Imaginary), testtype(PI*I, Type::Imaginary), testtype(sin(2*I), Type::Imaginary)
FALSE, FALSE, FALSE
In contrast to testtype
, the function is
performs a semantical test:
>> is(exp(3)*I, Type::Imaginary), is(PI*I, Type::Imaginary), is(sin(2*I), Type::Imaginary)
TRUE, TRUE, TRUE
Identifiers may be assumed to represent an imaginary number:
>> assume(x, Type::Imaginary): is(x, Type::Imaginary), Re(x), Im(x)
TRUE, 0, -I x
The imaginary numbers are a subset of the complex numbers:
>> is(x, Type::Complex)
TRUE
>> unassume(x):