MathGroup Archive 2012

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

Search the Archive

Bug in Sort !?!?


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 !?!?