Previous Up Next

6.3.17  Sorting

The sort command sorts lists and expression in various ways.

Note that using (x,y)->x>=y for f will to sort the list in decreasing order. This may also be used to sort a list of lists (that sort with one argument does not know how to sort).

Examples

sort([3,4,2])
     

2,3,4
          
sort(exp(2*ln(x))+x*y-x+y*x+2*x)
     
x y+elnx+x           
simplify(exp(2*ln(x))+x*y-x+y*x+2*x)
     
x2+2 x y+x           
sort([3,4,2],(x,y)->x>=y)
     

4,3,2
          

Previous Up Next