title: Unary minus and floating point number in OCaml
body: <p>I wanted to have a vector of complex numbers in my program, so I wrote this:</p>
  
  <pre><code>[|pt 0. 0.; pt -4. 1.; pt -7. -2.; pt 4. 5.; pt 1. 1.|]
  </code></pre>
  
  <p>Here <code>pt</code> is a function of type <code>float -&gt; float -&gt; Complex.t</code>.  But <code>ocaml</code> refused to compile this saying:</p>
  
  <pre><code>Characters 12-14:
    [|pt 0. 0.; pt -4. 1.; pt -7. -2.; pt 4. 5.; pt 1. 1.|];;
                ^^
  Error: This expression has type float -&gt; float -&gt; Complex.t
         but an expression was expected of type int
  </code></pre>
  
  <p>What I wanted to do here is (obviously) include the complex number whose real part is -4 and whose imaginary part is 1.  But <code>ocaml</code> treated what I intended to be an unary minus as a function of type <code>int -&gt; int -&gt;int</code>.</p>
  
  <p>What should I write to do what I wanted to?</p>