Previous Page Next Page Contents

Type::Even -- a type and a property representing even integers

Introduction

Type::Even represents even integers. This type can also be used as a property to mark identifiers as even integers.

Call(s)

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

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 assume, is and testtype

Related Functions

is, assume, testtype, Type::Odd, Type::Property

Details

Example 1

The following numbers are of type Type::Even:

>> testtype(2, Type::Even),
   testtype(-4, Type::Even),
   testtype(8, Type::Even),
   testtype(-11114, Type::Even),
   testtype(4185296581467695598, Type::Even)
                       TRUE, TRUE, TRUE, TRUE, TRUE

Example 2

We use this type as a property:

>> assume(x, Type::Even): 

The following calls to is derive the properties of a composite expression from the properties of its indeterminates:

>> is(3*x^2, Type::Even), is(x + 1, Type::Even)
                                TRUE, FALSE
>> is(x, Type::Integer), is(2*x, Type::Integer),
   is(x/2, Type::Integer), is(x/3, Type::Integer)
                         TRUE, TRUE, TRUE, UNKNOWN
>> assume(y, Type::Odd): is(x + y, Type::Even)
                                   FALSE
>> is(2*(x + y), Type::Even)
                                   TRUE
>> delete x, y:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000