Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


  • Prev by Date: Re: Table extraction
  • Next by Date: RE: Sort
  • Previous by thread: Re: Sort
  • Next by thread: RE: Sort