Previous Page Next Page Contents

Type::Imaginary -- a type and a property representing imaginary numbers

Introduction

Type::Imaginary represents complex numbers with vanishing real part. This type can also be used as a property to mark identifiers as imaginary numbers.

Call(s)

testtype(obj, Type::Imaginary)
assume(x, Type::Imaginary)
is(ex, Type::Imaginary)

Parameters

obj - any MuPAD object
x - an identifier
ex - an arithmetical expression

Parameters

obj - any MuPAD object

Returns

see assume, is and testtype

Related Functions

assume, is, testtype, Type::Complex, Type::Property

Details

Example 1

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

Example 2

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):

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000