## `Type::Complex` -- a type and a property representing complex numbers

#### Introduction

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

#### Parameters

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

#### Returns

see `assume`, `is` and `testtype`

#### Related Functions

`assume`, `is`, `testtype`, `Type::Imaginary`, `Type::Property`, `Type::Real`

#### Details

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

- This type represents a property that can be used in `assume` and `is`.

#### Example 1

The 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 2

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

#### Changes

- no changes

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