## `Type::Positive` -- a type and a property representing positive numbers

#### Introduction

`Type::Positive` represents positive numbers. `Type::Positive` is a property, too, which can be used in an `assume` call.

#### Call(s)

`testtype(obj,` Type::Positive)
`assume(x,` Type::Positive)
`is(ex,` Type::Positive)

#### Parameters

`obj` | - | any MuPAD object
`x` | - | an identifier or one of the expressions `Re(u)` or `Im(u)` with an identifier `u`
`ex` | - | an arithmetical expression

#### Returns

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

#### Related Functions

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

#### Details

- The call `testtype(obj,` Type::Positive) checks, whether `obj` is a positive real number and returns `TRUE`, if it holds, otherwise `FALSE`.
- `testtype` only performs a syntactical test identifying MuPAD objects of type `DOM_INT`, `DOM_RAT` and `DOM_FLOAT` and checks, if `bool(obj > 0)` holds. This does not include arithmetical expressions such as `exp(1)`, which are not identified as of type `Type::Positive`.
- The call `assume(x,` Type::Positive) marks the identifier `x` as a positive real number.

  The call `is(ex,` Type::Positive) derives, whether the expression `ex` is a positive real number (or this property can be derived).

- This type represents a property that can be used in `assume` and `is`.
- Instead of `Type::Positive` the assumption can also be `assume(x > 0)`.

#### Example 1

The following numbers are of type `Type::Positive`:

    >> testtype(2, Type::Positive),
       testtype(3/4, Type::Positive),
       testtype(0.123, Type::Positive),
       testtype(1, Type::Positive),
       testtype(1.02, Type::Positive)

                           TRUE, TRUE, TRUE, TRUE, TRUE

The following expressions are exact representations of positive numbers, but syntactically they are not of `Type::Positive`:

    >> testtype(exp(1), Type::Positive),
       testtype(PI^2 + 5, Type::Positive),
       testtype(sin(2), Type::Positive)

                                FALSE, FALSE, FALSE

Ths function `is`, however, realizes that they are, indeed, positive:

    >> is(exp(1), Type::Positive),
       is(PI^2 + 5, Type::Positive),
       is(sin(2), Type::Positive)

                                 TRUE, TRUE, TRUE

#### Example 2

Assume an identifier is positive:

    >> assume(x, Type::Positive):
       is(x, Type::Positive)

                                       TRUE

This is equivalent to:

    >> assume(x > 0):
       is(x > 0)

                                       TRUE

Also positive numbers are real:

    >> assume(x, Type::Positive):
       is(x, Type::Real)

                                       TRUE

But real numbers can be positive or not:

    >> assume(x, Type::Real):
       is(x, Type::Positive)

                                      UNKNOWN

    >> delete x:

#### Changes

- no changes

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