3 Replies Latest reply on Dec 1, 2006 7:29 PM by 796440

    Adding two possitive numbers results a negative????

      Hello everybody i posted that in an other subforum but i guess it was the wrong place. I have a strange problem that it's racking my brain! i have the following code
      for (int i=0;i<ascii.length;i++){
      int randNum=rand.nextInt(100000000); 
      (ascii[i] is an array of four integers that picture an ascii characters).

      Normaly that would result a buffer full of positive numbers.In my case thats not always true. Many times i get as a result a negative number even if the other two numbers that i add are positive. What's wrong here?? Thanks in advance!