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


Groups > comp.lang.java.help > #1181

Re: Reverse sorting an array

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!74.125.46.80.MISMATCH!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.help
Subject Re: Reverse sorting an array
Date Sat, 1 Oct 2011 20:21:13 -0700 (PDT)
Organization http://groups.google.com
Lines 29
Message-ID <6191103.779.1317525673193.JavaMail.geo-discussion-forums@prfc6> (permalink)
References <8ea2add1-ce9c-423b-bdb8-92c461cf9c6d@5g2000yqo.googlegroups.com> <j64aek$23e$1@dont-email.me> <5ff0ec30-9ffe-4513-ac55-c5d16f141399@u6g2000vbo.googlegroups.com> <j65o5r$huv$1@dont-email.me> <1jjf871i3ug6e4fui8aaanln5h21r17m0h@4ax.com> <j68k2d$8o0$1@dont-email.me>
Reply-To comp.lang.java.help@googlegroups.com
NNTP-Posting-Host 216.239.45.130
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1317526002 11599 127.0.0.1 (2 Oct 2011 03:26:42 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Sun, 2 Oct 2011 03:26:42 +0000 (UTC)
In-Reply-To <j68k2d$8o0$1@dont-email.me>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=216.239.45.130; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
User-Agent G2/1.0
X-Google-Web-Client true
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.help:1181

Show key headers only | View raw


Eric Sosman wrote:
> Roedy Green wrote:
>> Eric Sosman wrote, quoted or indirectly quoted someone who said :
>>>  * Negate every element of the array, use Arrays.sort() to put the
>>>    array in ascending order, and then negate all the elements again.
>>>    (Note that this won't work if Integer.MIN_VALUE appears in the
>>>    array, because Integer.MIN_VALUE == -Integer.MIN_VALUE.)
>> oops
>>
>> because Integer.MIN_VALUE != -Integer.MIN_VALUE
> 
>      "I meant what I said, and I said what I meant."  But if you
> don't believe me, try it yourself:
> 
> public class Asymmetry {
>   public static void main(String[] unused) {
>     System.out.println(
>         Integer.MIN_VALUE == -Integer.MIN_VALUE);
>   }
> }
> 
> Welcome to the world of fixed-precision two's complement arithmetic.

You can't chop down asymmetry.

-- 
Lew
(with apologies to Jane Siberry
http://en.wikipedia.org/wiki/Jane_Siberry)

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Reverse sorting an array Fred <albert.xtheunknown0@gmail.com> - 2011-09-30 04:03 -0700
  Re: Reverse sorting an array Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-30 07:50 -0400
    Re: Reverse sorting an array Fred <albert.xtheunknown0@gmail.com> - 2011-09-30 15:24 -0700
      Re: Reverse sorting an array Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-30 20:50 -0400
        Re: Reverse sorting an array Roedy Green <see_website@mindprod.com.invalid> - 2011-10-01 19:38 -0700
          Re: Reverse sorting an array Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-01 22:58 -0400
            Re: Reverse sorting an array Lew <lewbloch@gmail.com> - 2011-10-01 20:21 -0700
    Re: Reverse sorting an array Fred <albert.xtheunknown0@gmail.com> - 2011-09-30 15:31 -0700
      Re: Reverse sorting an array Roedy Green <see_website@mindprod.com.invalid> - 2011-09-30 15:45 -0700
        Re: Reverse sorting an array Fred <albert.xtheunknown0@gmail.com> - 2011-09-30 16:27 -0700
          Re: Reverse sorting an array Patricia Shanahan <pats@acm.org> - 2011-09-30 16:58 -0700
    Re: Reverse sorting an array Roedy Green <see_website@mindprod.com.invalid> - 2011-09-30 15:43 -0700
      Re: Reverse sorting an array Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-30 20:57 -0400
  Re: Reverse sorting an array Roedy Green <see_website@mindprod.com.invalid> - 2011-09-30 04:58 -0700
    What qualifies as a constant ? (Was: Reverse sorting an array) Mayeul <mayeul.marguet@free.fr> - 2011-09-30 14:45 +0200
      Re: What qualifies as a constant ? (Was: Reverse sorting an array) Lew <lewbloch@gmail.com> - 2011-09-30 07:39 -0700
        Re: What qualifies as a constant ? (Was: Reverse sorting an array) Mayeul <mayeul.marguet@free.fr> - 2011-09-30 17:15 +0200
          Re: What qualifies as a constant ? (Was: Reverse sorting an array) Lew <lewbloch@gmail.com> - 2011-09-30 08:42 -0700

csiph-web