Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #10543
| From | James Stein <mathgroup@stein.org> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Bug in Sort !?!? |
| Date | 2012-06-19 07:18 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jrp94p$qbs$1@smc.vnet.net> (permalink) |
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
Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread
Bug in Sort !?!? James Stein <mathgroup@stein.org> - 2012-06-19 07:18 +0000 Re: Bug in Sort !?!? David Bailey <dave@removedbailey.co.uk> - 2012-06-21 09:16 +0000 Re: Bug in Sort !?!? nanobio9 <kuokan.liang@gmail.com> - 2012-06-21 09:16 +0000 Re: Bug in Sort !?!? James Stein <mathgroup@stein.org> - 2012-06-22 07:01 +0000
csiph-web