home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,538 of 68,980   
   Tom Del Rosso to Tom Del Rosso   
   Re: FOR /L counting limit   
   20 May 20 23:06:50   
   
   From: fizzbintuesday@that-google-mail-domain.com   
      
   Tom Del Rosso wrote:   
   > This counts into the millions if you leave it running, but how high   
   > will it go?   
   >   
   > for /l %%a in   
   > (1,1,100000000000000000000000000000000000000000000000000000000000000000000)   
   > do @echo %%a   
      
   Maybe I was too eager to make conversation so I posted the question   
   before investigating.  Simply starting from a larger number shows that   
   it is 32 bits, and it rolls over to -2^31.   
      
   What's interesting is that if you start with any number larger than   
   +2^31-1 then it starts at +2^31-1 and immediately rolls over to -2^31.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca