Actually the widening conversion does not take place. Since MAX_VALUE (7FFFFFFF) multiplied by 2 make the int a negative number the condition will always fail for a positive lNum. Try forcing the widening like this:
if(lNum <= (Integer.MAX_VALUE*2L)) {
// Do something;
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.