SML exponentiation of real with integer
<p>I wrote a function that does exponentiation with a base, b and the exponent e as follows:</p>

<pre><code>fun power b e = if e = 0 then 1 else b * power b (e-1);
</code></pre>

<p>obviously this is works on integers as shown by the output:</p>

<pre><code>val power = fn : int -&gt; int -&gt; int
</code></pre>

<p>However, I want it to take a real for b and an integer for e. I tried to use the following:</p>

<pre><code>fun power (b : real) (e : int) = if e = 0 then 1 else b * power b (e-1);
</code></pre>

<p>This gives me errors though. Any help is appreciated.</p>