home bbs files messages ]

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

   comp.compilers      Compiler construction, theory, etc. (Mod      2,753 messages   

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

   Message 1,832 of 2,753   
   glen herrmannsfeldt to Quinn Tyler Jackson   
   Re: Executing code at compilation time   
   17 Mar 10 05:54:37   
   
   From: gah@ugcs.caltech.edu   
      
   Quinn Tyler Jackson  wrote:   
   (snip)   
      
   >>      for(k = 0; k < 1000; k++)   
   >>        if(i * i + j * j + k * k % 7 == 0) t++;   
      
   This looks suspicious for the symmetry that it doesn't have.   
   It evaluates as:   
      
             if(((i * i) + (j * j) + (k * k % 7)) == 0) t++;   
      
   The compiler might be able to figure out that when i or j   
   is positive that the if condition is false.   
      
           if((i * i + j * j + k * k) % 7 == 0) t++;   
      
   would have a very different result.   
      
   -- glen   
      
   --- 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