title: C Project Euler Numbers Primes
body: <p>So,im resolving problem 10, and reach to one solution:</p>
  
  <pre><code>acu = 0;
  for(i=2;i&lt;=2000000;i++){        
      if(primo(i)== 1){
          acu = acu + i;
      }
  }   
  </code></pre>
  
  <p>where primo is :</p>
  
  <pre><code>int primo(long num){
  
  long pd;
  
  pd = num/2;
  
  while(pd &gt; 1 &amp;&amp; num%pd != 0){
      pd--;
  }
  if (pd == 1)
      return 1;
  else
      return -1;}
  </code></pre>
  
  <p>The time to executed in my machine was something like 700 seconds. Then i change this in the code:</p>
  
  <pre><code>int primo(long num){
  
  long pd;
  
  pd = lround(sqrt(num));
  
  while(pd &gt; 1 &amp;&amp; num%pd != 0){
      pd--;
  }
  if (pd == 1)
      return 1;
  else
      return -1;}
  </code></pre>
  
  <p>and the executed time was like 15 seconds. Why is so much difference between num/2 and lround(sqrt(num)) ?</p>