## `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

- The call `testtype(obj,` Type::Odd) checks, whether `obj` is an odd number and returns `TRUE`, if it holds, otherwise `FALSE`.
- `testtype` only performs a syntactical test identifying MuPAD objects of type `DOM_INT` and checks, if `bool(domtype((x-1)/2) = DOM_INT)` holds.
- The call `assume(x,` Type::Odd) marks the identifier `x` as an odd number.

  The call `is(ex,` Type::Odd) derives, whether the expression `ex` is an odd number (or this property can be derived).

- This type represents a property that can be used in `assume` and `is`.

#### 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

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000