title: Error "expression must have integral or enum type" in thats code:
body: <p>Error "expression must have integral or enum type" in thats code:</p>
  
  <pre><code>__global__ void VectorKernel(float *a, float *b, float *c, int n)
  {
      int i = threadIdx.x;
      float y = 0, z = 0;
  
  if (i &lt; n)
  
      y = (b-a) / n;
  
      for (float j = y; j &lt;= n ; j++) {
          z = (((j+y) - j) / 6) * function(j) + 4 * (function((j + (y+j)) / 2)) + function(y+j);
  
          c = c + z;
      }
  }
  </code></pre>
  
  <p>the error happen in "z", in stretch:</p>
  
  <pre><code>c = c + z;
  </code></pre>
  
  <p>(i'm beginner in CUDA programming)</p>