title: While loop condition with double and float
body: <p>i have a simple task that says 'Write the value of y with the following formula for the range between xmin and xmax with the difference of dx.
  The only problem i have is that when using while with float, such as in code i am going to provide, i am getting one less output of y than i should have.
  For the following code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main() {
      float x,xmin,xmax,dx,y;
      printf("Input the values of xmin xmax i dx");
      scanf("%f%f%f",&amp;xmin,&amp;xmax,&amp;dx);
      x=xmin;
      while(x&lt;=xmax) {
          y=(x*x-2*x-2)/(x*x+1);
          printf("%.3f   %.3f\n",x,y);
          x=x+dx;
      }
  }
  </code></pre>
  
  <p>for the input of (-2 2 0.2) i get output only up to 1.8 (that's 20 outputs) and not up to 2.
  But when i use double instead of float everything works just fine (Has 21 outputs).
  Is there something connected to the while condition that i am not aware of?</p>