Re: Bug in Sort !?!?
- To: mathgroup at smc.vnet.net
- Subject: [mg126986] Re: Bug in Sort !?!?
- From: James Stein <mathgroup at stein.org>
- Date: Fri, 22 Jun 2012 02:59:50 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jrp94p$qbs$1@smc.vnet.net> <201206210915.FAA15894@smc.vnet.net>
KKL is correct; my apologies to all. On Thu, Jun 21, 2012 at 2:15 AM, nanobio9 <kuokan.liang at gmail.com> wrote: > On 6=E6=9C=8819=E6=97=A5, =E4=B8=8B=E5=8D=883=E6=99=8218=E5=88=86, James Stein <mathgr... at stein.org> wrote: >> 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 > > The character code of "." is 46, smaller than "a", "1", etc. I do not > see a bug here. > > Regards, > KKL >
- References:
- Re: Bug in Sort !?!?
- From: nanobio9 <kuokan.liang@gmail.com>
- Re: Bug in Sort !?!?