## `Type::RatExpr` -- type for testing rational expressions

#### Introduction

With `Type::RatExpr`, rational expressions can be identified.

#### Call(s)

`testtype(obj,` Type::RatExpr(indet <, coeff_type>`)`)

#### Parameters

`obj` | - | any MuPAD object
`indet` | - | an indeterminante
`coeff_type` | - | a type for the coefficientes; a type can be an object of the library `Type` or one of the possible return values of `domtype` and `type`

#### Returns

see `testtype`

#### Related Functions

`testtype`, `indets`

#### Details

- The call `testtype(obj,` Type::RatExpr(indet`)`) checks, whether `obj` is a rational expression in the indeterminante `indet`, i.e., the quotient of two polynomial expressions in `indet`. If it is, the result is `TRUE`, otherwise `FALSE`.
- A rational expression in `indet` is a MuPAD expression, and `indet` occurs only as operand of `_plus` or `_mult` expressions and in `_power` with an integer exponent.
- This type expects one or more arguments `Type::RatExpr(`indet <, coeff_type>`)`.
- `indet` must be an identifier, and `coeff_type` a type for the coefficients of the rational expression.
- This type does not represent a property.

#### Example 1

A polynomial expression in `x` is also a rational expression in `x`:

    >> testtype(-x^2 - x + 3, Type::RatExpr(x))

                                       TRUE

`testtype` is used to select all rational operands in `x` with positive integer coefficients:

    >> EX := sin(x) + x^2 - 3*x + 2 + 3/x:
       select(EX, testtype, Type::RatExpr(x, Type::PosInt))

                                    3    2
                                    - + x  + 2
                                    x

    >> delete EX:

#### Changes

- no changes

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