Function: math[rangemembers] - determines the elements included in a range
Calling Sequence:
rangemembers(e, a .. b);
rangemembers(e, RealRange(a, b));
Parameters:
e
- an expression, list or set
a, b
- numerical boundary points
Description:
rangemembers determines whether the expression e, or the elements of list or set e are elements of the interval a .. b.
The return is a numerically sorted sequence of those elements that were determined to exist in that interval. If no element is found to be included in the interval, NULL is returned.
The elements of e should be of type numeric, otherwise if an element is not of type numeric, it is simply ignored.
Besides of a Maple range a .. b, the function also accepts a RealRange(a, b) expression. a, b may also be -infinity or +infinity.
Both for a Maple range and a RealRange, a, b may also be calls to the Open `property`. rangemembers converts an Open(x) expression to a numerical value by using the global variable _MathEps which is assigned 10^(-Digits+1) by default and may be changed in its value by the user. If Open(x) is a left interval boundary point Open(x) evaluates to x + _MathEps, if it is a right interval boundary point Open(x) evaluates to x - _MathEps.
Shortcuts for this function are 'rangemem' and 'rmem'.
This function is part of the math package, and so can be used only after performing the command with(math) or with(math, rangemembers).
Examples:
> with(math, rangemembers):
> rangemembers(1, 0 .. 1);
> rangemembers({-1, 0, 0.5, 1, a}, 0 .. 1);
> rmem(1, RealRange(Open(0), 2));
> rmem(2, Open(1) .. 3);
> rmem(1, Open(0) .. infinity);
See Also:
member , convert/range , convert/RealRange .
Version History:
Version 1.0 as of May 26, 1997
Version 2.0 as of December 28, 1997
Version 2.0.1 as of December 21, 1998