
-----------------------------------
cool dude
Tue Jul 04, 2006 9:00 am

large counted loop
-----------------------------------
if you have to go to a very large number in a counted loop, it will say integer too large. so how would i do that? i tried using BigInteger, but it is not working and i'm not too sure if that is right?

-----------------------------------
r.3volved
Tue Jul 04, 2006 12:10 pm


-----------------------------------
counted loop as in a 'for' loop??

long myNum = 0;
while(myNum != 623456823746L)
{
   ++myNum;
}


if it's so long that it won't let you do a for loop, then a forloop probably isn't the best aproach

-----------------------------------
cool dude
Tue Jul 04, 2006 1:26 pm


-----------------------------------
counted loop as in a 'for' loop??

long myNum = 0;
while(myNum != 623456823746L)
{
   ++myNum;
}


if it's so long that it won't let you do a for loop, then a forloop probably isn't the best aproach

yes counted loop as a for loop. and i need the for loop. 

p.s. why do you have a L at the end of the number?

-----------------------------------
TheFerret
Tue Jul 04, 2006 1:29 pm


-----------------------------------
You could have a different variable type in the counter if needed, like:

for(long i=0; i