Previous Page Next Page Contents

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

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




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000