title: Why I get "This expression has type int but an expression was expected of type float" error?
body: <p>I need to find the square roots of a quadratic equation: ax^2+bx+c=0.    </p>
  
  <pre><code>let h a b c = 
    if (b*b-4*a*c) &lt; 0 then begin 
      print_string "There are no real solutions" 
    end
    else if (b*b-4*a*c) = 0 then begin
      print_string "The equation has 1 solution x_1=";
      print_int ((-b)/(2*a));
    end
    else begin
      float_of_int a;
      float_of_int b;
      float_of_int c;
      print_float (((-.b)+.sqrt(b*.b-.4.*.a*.c))/.(2.*.a)); 
      print_float (((-.b)-.sqrt(b*.b-.4.*.a*.c))/.(2.*.a))
    end;;
  </code></pre>
  
  <p>Why this code gives me syntax error here saying that "This expression has type int but an expression was expected of type float":</p>
  
  <pre><code>begin
    float_of_int a;
    float_of_int b;
    float_of_int c;
    print_float (((-.b)+.sqrt(b*.b-.4.*.a*.c))/.(2.*.a)); 
    print_float (((-.b)-.sqrt(b*.b-.4.*.a*.c))/.(2.*.a))
  end;;
  </code></pre>
  
  <p>Also is there any other easier way to solve this problem?</p>