I'm a newbie on OCaml and I was trying to make a tail recursion function what calculates the factorial of a float. Here's what I've done:
let factorial num =
let rec aux i f =
if i=num then f
else aux (i+.1.) (float f*.(i+.1.))
in aux 0. 1.;;
It gives me this error: This expression has type float but an expression was expected of type int.
I don't know how to fix that 'cause I can't find where's the error.
float f
in the 4th line? – Basile Starynkevitch