Previous Page Next Page Contents

Type::NonNegative -- a type and a property representing nonnegative numbers

Introduction

Type::NonNegative represents nonnegative numbers. Type::NonNegative is a property, too, which can be used in an assume call.

Call(s)

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

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::Real, Type::Property

Details

Example 1

The following numbers are of type Type::NonNegative:

>> testtype(2, Type::NonNegative),
   testtype(3/4, Type::NonNegative),
   testtype(0.123, Type::NonNegative),
   testtype(0, Type::NonNegative),
   testtype(1.02, Type::NonNegative)
                       TRUE, TRUE, TRUE, TRUE, TRUE

The following expressions are exact representations of nonnegative numbers, but syntactically they are not of Type::NonNegative:

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

The function is, however, can find these expressions to be nonnegative:

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

Example 2

Assume an identifier is nonnegative:

>> assume(x, Type::NonNegative):
   is(x, Type::NonNegative)
                                   TRUE

This is equal to:

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

Also nonnegative numbers are real:

>> assume(x, Type::NonNegative):
   is(x, Type::Real)
                                   TRUE

But real numbers can be nonnegative or not:

>> assume(x, Type::Real):
   is(x, Type::NonNegative)
                                  UNKNOWN
>> delete x:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000