java - Infinite loop value -


what initial values of x make loop infinite? told answer 123, don't understand how. can explain this?

do  {    x = x - 3; }  while (x < 120); 

no value cause loop infinite loop. in java, integral primitive values underflow positive number, , loop end.

as example:

int x = integer.min_value;  {     x = x - 3;      system.out.println(x); } while (x < 120);  

will output:

2147483645 

Comments

Popular posts from this blog

Linux vanilla kernel on QEMU and networking with eth0 -

rdbms - what exactly the undo information lives in oracle? -

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -