Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Sort with -Infinity fails

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73894] Re: Sort with -Infinity fails
  • From: "Norbert Marxer" <marxer at mec.li>
  • Date: Sat, 3 Mar 2007 00:47:53 -0500 (EST)
  • References: <es6d0l$rmr$1@smc.vnet.net>

On 1 Mrz., 12:21, Tom Aldenberg <Tom.Aldenb... at rivm.nl> wrote:
> Dear MathGroup,
>
> Minus Infinity (-Infinity) is smaller than -8, but Sort does not sort it =
as
> expected.
> Is there a Real minus Infinity?
>
> In[75]:=
> =C2=A0 =C2=A0 =C2=A0 -Infinity < -8
> Out[75]=
> =C2=A0 =C2=A0 =C2=A0 True
>
> In[76]:=
> =C2=A0 =C2=A0 =C2=A0 Sort[{-Infinity, -8, 5}]
> Out[76]=
> =C2=A0 =C2=A0 =C2=A0 {-8, 5, -=E2=88=9E}
>
> Regards,
>
> Tom Aldenberg
>
>
> DISCLAIMER: =C2=A0http://www.rivm.nl/disclaimer.htm

Hello

Sort uses by default canonical ordering (whatever this means with
respect to -Infinity).

    Sort[{-Infinity, -8, 5}, Less]

will give what you want.

Best Regards
Norbert Marxer




  • Prev by Date: Re: Problems with simplify and Sqrt[a^2]
  • Next by Date: Re: fastest way to add up a billion numbers
  • Previous by thread: Re: Sort with -Infinity fails
  • Next by thread: Interrupt Service Routines in Mathematica v.5.2?