Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Bug in Sort !?!?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126949] Bug in Sort !?!?
  • From: James Stein <mathgroup at stein.org>
  • Date: Tue, 19 Jun 2012 03:16:58 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

The documentation says: "Sort orders strings as in a dictionary, with
uppercase versions of letters coming after lowercase ones." It is
therefore unsurprising that { "3", "4", "4b" } are already sorted.
But who can correctly predict the three True/False values produced by
the six lines below? (And who can explain it?)

s={"3","4","4b"};
Sort[s] == s
s=Map[StringJoin[#,"."]&,s];
Sort[s] == s
s=Map[StringJoin[#,"nb"]&,s];
Sort[s] == s



  • Prev by Date: Re: FrameLabel and Style
  • Next by Date: Re: Varying a constant in an ODE to Manipulate solution
  • Previous by thread: Eigendecomposition problem?
  • Next by thread: Re: Bug in Sort !?!?