Quantcast
Channel: Reza's Weblog
Viewing all articles
Browse latest Browse all 50

Integer Underflow

$
0
0

It is stupid that java underflows when it reaches the boundries of some primities types.

For example:

int i = Integer.MAX_VALUE + 1;

goes back to the lowest possible int which is also a negative number!

They probably could design it differently as some other languages have this. So be ware of this specially in loops!


Viewing all articles
Browse latest Browse all 50

Trending Articles