Function: math[getreals] - returns those values that are real but not complex
Calling Sequence:
getreals(expr);
getreals(expr, 'approx');
Parameters:
expr
- any algebraic expression, a sequence of algebraic expressions,
or a list or set of algebraic expressions
Description:
getreals returns each element k in expr that is of type real .
The return is a sequence of real, but not complex, values. If no real has been found in expr, NULL is returned.
If the approx option is given, then in complex values with imaginary parts b*i with b < _MathEps these imaginary parts are cancelled using math/cancel , leaving the real parts. _MathEps is an environment variable assigned with the initialization of the math package.
This function is part of the math package, and so can be used only after performing the command with(math) or with(math, getreals).
Examples:
> with(math):
> getreals(a, sqrt(-1), 1, .5, 1/2);
> getreals(2, ln(-2));
> getreals(I);
> getreals(I*1e-10);
> getreals(I*1e-10, approx);
See Also:
type/irrational , type/cmplx , type/real .
Version History:
Version 1.0 as of December 30, 1997
Version 2.0 as of January 07, 1999
Version 2.1 as of July 20, 2000