Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec factorial = function
- | (0|1) -> 1
- | n -> n * factorial(n - 1);;
- let rec gen_e (sum:float) (n:int) : float =
- match n with
- | 0 -> sum
- | n -> sum -> sum +. gen_e (1.0 /. float_of_int(factorial n)) (n - 1);;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement