Previous Page Next Page Contents

Type::NonNegInt -- a type and a property representing nonnegative integers

Introduction

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

Call(s)

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

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

Details

Example 1

The following numbers are of type Type::NonNegInt:

>> testtype(2, Type::NonNegInt),
   testtype(3/4, Type::NonNegInt),
   testtype(55/111, Type::NonNegInt),
   testtype(1, Type::NonNegInt),
   testtype(111/111111, Type::NonNegInt)
                      TRUE, FALSE, FALSE, TRUE, FALSE

Example 2

Assume an identifier is nonnegative rational:

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

Also nonnegative integers are integers:

>> assume(x, Type::NonNegInt):
   is(x, Type::Integer)
                                   TRUE

However, integers can be nonnegative or not:

>> assume(x, Type::Integer):
   is(x, Type::NonNegInt)
                                  UNKNOWN
>> delete x:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000