Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7679 > unrolled thread

Re: SortBy won't order irrationals

Started byChristopher Young <cy56@comcast.net>
First post2012-01-09 08:19 +0000
Last post2012-01-09 08:19 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re:  SortBy won't order irrationals Christopher Young <cy56@comcast.net> - 2012-01-09 08:19 +0000

#7679 — Re: SortBy won't order irrationals

FromChristopher Young <cy56@comcast.net>
Date2012-01-09 08:19 +0000
SubjectRe: SortBy won't order irrationals
Message-ID<jee7u7$cqf$1@smc.vnet.net>
OK, but that's not the behavior I'd expect, and it's something that has 
to be watched out for constantly. For example, if we use SortBy, I think 
that after all the functions have been applied to the list, we're stuck 
with this sorting  by complexity of expression unless we remember to 
apply N to every element of the list together with each of our other 
functions.

On Jan 6, 2012, at 5:46 PM, Andrzej Kozlowski wrote:

> Numeric symbols like Sqrt[2],Pi,E  etc.  etc are not sorted by their 
value but in the same way as all other symbols. Compare:
>
> Sort[{Pi, 4, Sqrt[2], 2, 3*E}]
>
> {2, 4, Sqrt[2], 3*E, Pi}
>
> with
>
> Sort[{Pi, 4, Sqrt[2], 2, 3*E}, Less]
>
> {Sqrt[2], 2, Pi, 4, 3*E}
>
>
> Note also that you can use Sort with a custom ordering function.
>
>
> Andrzej Kozlowski



[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web