A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
Programmer Certification (SCJP/OCPJP)
Joined: Apr 15, 2005
Jul 25, 2005 22:52:00
This is a question related to Math.abs().
Why Math.abs(Integer.MIN_VALUE)and Math.abs(Long.MIN_VALUE)returns -ve value.
Looking forward for your valuable answers??
Thanks in advance..
Rgds.<br /> <a href="mailto:email@example.com" rel="nofollow">firstname.lastname@example.org</a>
Joined: Jul 11, 2003
Jul 26, 2005 01:40:00
The negation of Integer.MIN_VALUE (-2147483648) will result in overflow since the range for
is -2147483648 to 2147483647. Same for
I agree. Here's the link:
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
Challenge: circular counter without conditional branches
help with this Q
howto eliminate negative sign of number ?
Where am I wrong??
Math.abs(Integer.MIN_VALUE)) not returning abs val
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013