News for hackers. Stuff that matters.
Re:The compiler is always right by ikusalic on Sunday May 11, 2014 @07:29AM (#7728413)
Here's one absurd bug in Java that really surprised me:

Math.abs(-2147483647); // 2147483647

Math.abs(-2147483648); // -2147483648

When you know this behavior, it's kinda obvious why, but still...

Re:The compiler is always right by rwallace on Sunday May 11, 2014 @11:56PM (#7731151)
Well, not just kind of obvious why, but kind of obvious it's not a bug in Java! If you're dealing with quantities that don't fit in a 32-bit twos complement integer, you need to use a larger datatype.
Re:The compiler is always right by foxhill on Sunday May 11, 2014 @11:54AM (#7728969)
well, i'd only consider that a bug if java defines that integers will use at least as many bits as needed to store their value.

i'd guess this is not the case (but i don't know for sure)