## `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

- The call `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`.
- The call `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).

- This type represents a property that can be used in `assume` and `is`.
- The call `assume(Re(x) = 0)` has the same meaning as `assume(x,` Type::Imaginary).

#### 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

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000