title: freeGLUT grid drawing not drawing fully at specific values
body: <p>I am trying to draw a 2 dimensional grid depending on a given gridSize given by the user (the grid is always a square). 
  However, for some values of the grid, the top line and the right line of the grid do not draw. For the life of me, I cannot figure out what is wrong with my code here.</p>
  
  <p>This is my code in my render method to draw the grid:</p>
  
  <pre><code>glBegin(GL_LINES);
  
  for (float i = -1.0f; i &lt;= 1.0f; i += 2.0f/(gridSize)) {
      glVertex2f(i, 1.0f);
      glVertex2f(i, -1.0f);
  
      glVertex2f(-1.0f, i);
      glVertex2f(1.0f, i);
  }
  glEnd();
  </code></pre>
  
  <p>gridSize is just the user input for the size of the grid. I divide by 2.0, since
  I want my grid to have a constant width and height of 2.0x2.0.</p>
  
  <p>Values like 10, 25, 100 all work fine,
  but values such as 50 don't draw the top and left line, as shown <a href="https://i.stack.imgur.com/AYo0e.png" rel="nofollow noreferrer">here</a></p>
  
  <p>It might be some dumb detail that i'm missing, but i just can't see anything wrong with my code.</p>