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


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

Re: Reverse sorting an array

From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.help
Subject Re: Reverse sorting an array
Date 2011-10-01 20:21 -0700
Organization http://groups.google.com
Message-ID <6191103.779.1317525673193.JavaMail.geo-discussion-forums@prfc6> (permalink)
References (1 earlier) <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>

Show all headers | 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