Function: type/irrational - check for an irrational value

Calling Sequence:

type(n, irrational);

Parameters:

n - any expression

Description:

The call type(n, irrational) checks to see if n is irrational; if so, it returns true, and false otherwise.

An expression is of type irrational if it is of type realcons but not one of the following types: integer , rational , or float . n is also not of type irrational if it is +/- infinity.

Note that if you pass a function or an expression containing one or more functions with an argument of type float, type(expr, irrational) evaluates to false although the expression might represent an irrational value in a mathematical sense.

This type is part of the math package and automatically initialized when this package is loaded.

Examples:

> with(math):

> type(sqrt(2), irrational);

[Maple Math]

> type(sqrt(2.), irrational);

[Maple Math]

> type(1, irrational);

[Maple Math]

> type(Pi, irrational);

[Maple Math]

See Also:

type , type/real , type/cmplx .

Version History:

Version 1.0 - 1997

Version 2.0 - January 06, 1999