Previous Page Next Page Contents

Type::Odd -- a type and a property representing odd integers

Introduction

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

Call(s)

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

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

Details

Example 1

The following numbers are of type Type::Odd:

>> testtype(1, Type::Odd),
   testtype(-3, Type::Odd),
   testtype(7, Type::Odd),
   testtype(-11113, Type::Odd),
   testtype(4185296581467695597, Type::Odd)
                       TRUE, TRUE, TRUE, TRUE, TRUE

Example 2

Assume an identifier is odd:

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

All odd numbers are integer:

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

However, integers can be odd or not:

>> assume(x, Type::Integer):
   is(x, Type::Odd)
                                  UNKNOWN

However, even numbers are not odd:

>> assume(x, Type::Odd):
   is(2*x, Type::Odd)
                                   FALSE
>> assume(n, Type::Even):
   is(x*n, Type::Odd)
                                   FALSE
>> is(x*n + 1, Type::Odd)
                                   TRUE
>> delete x, n:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000