Function: math[realsort] - sorts real values in ascending order

Calling Sequence:

realsort(expr);

Parameters:

expr - a sequence or list or set of expressions of type realcons

Description:

realsort takes a sequence or list or set expr of real values [Maple Math] .. [Maple Math] , internally stores the elements [Maple Math] in a table tbl where

tbl[evalf( [Maple Math] )] := [Maple Math] ,

converts all elements in expr to Maple floats and then applies sort to those floats. After sorting
each float evalf(
[Maple Math] ) is replaced by [Maple Math] again.

The return of realsort is a sequence if expr is a sequence, a list if expr is a list, and a set if expr is a set (in the last case, there is no sorting).

This function is part of the math package, and so can be used only after performing the command with(math) or with(math, realsort).

Examples:

> with(math, realsort):

> li := [1, Pi, exp(1), 0, 1/2];

[Maple Math]

> sort(li);

[Maple Math]

> realsort(li);

[Maple Math]

See Also:

sort .

Version History:

Version 1.0 as of February 14, 1998

Version 1.1 as of June 10, 1998