title: Float of double? Error in calculations, using double
body: <p>Very interesting thing. The simplest source code to find the result of equation: ax + b = 0. I was wonder, when double x = -13/12 = -1.000000; and
  double x = -12/13= 0.000000; (for a and b int(type converted) or double), but float or double x = -13f/12f = 1.083333 (that's right).
  What wrong with double?</p>
  
  <p>and can the equation {double or float x = -((double or float)b)/a;} be right if {int a,b;}?? if it cannot be right - why?</p>
  
  <pre><code>int main()
  {
   double a, b, x; 
   scanf("%f %f",&amp;a, &amp;b);
   fflush(stdin);
   if(a!=0)
   {x = -b/a; printf("x = %f", x);}
   else printf("There is no solve in your equation.");
   getchar();
   return 0;
  }
  </code></pre>
  
  <p>thank you</p>