RE: Sort
- To: mathgroup at smc.vnet.net
- Subject: [mg19188] RE: Sort
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Tue, 10 Aug 1999 02:52:47 -0400
- Sender: owner-wri-mathgroup at wolfram.com
I discovered something related behavior
Hermann Meier noted about Sort.
-------------------
Sort, Union, Intersection, and Complement each
return a "sorted" list in the examples below, but
the lists aren't sorted according to their
numeric value.
In[1]:=
Sort[{0,-3,-Pi,5,Pi/2}]
Out[1]=
{-3, 0, 5, -Pi, Pi/2}
In[2]:=
Union[{0,-3,-Pi,5,Pi/2}]
Out[2]=
{-3, 0, 5, -Pi, Pi/2}
In[3]:=
Intersection[{-3,5,-Pi},{-3,0,5,-Pi,Pi/2}]
Out[3]=
{-3, 5, -Pi}
In[4]:=
Complement[{-3,0,5,-Pi,Pi/2},{0,Pi/2,6,8}]
Out[4]=
{-3, 5, -Pi}
-----------------------
I am pretty sure the lists above are sorted
by the method described in Section A.3.9 in
The Mathematica Book. Below I give a hyperlink to
that section.
(************)
Cell[BoxData[
RowBox[{" ",
ButtonBox[
RowBox[{"A", ".3", ".9"}],
ButtonStyle->"MainBookLink"]}]], "Text"]
(************)
-----------------
Regards,
Ted Ersek