What could be the rational behind this just providing one int/long whose abs value is < 0...any thoughts??
I don�t know. What else could Math.abs(Integer.MIN_VALUE) be? an ArithmeticException. Interger.MAX_VALUE + 1 < 0. The addition does not cause an exception. We live with it.
The Java Programming Language (where I get my insights into language design) says "the absolute value of the most negative value of an int or long its itself and therefore negative; that's how two's complement integers work.
Here is the source code.
public static int abs(int a) { return (a < 0) ? -a : a; }
[ June 14, 2003: Message edited by: Marlene Miller ]