So, this is my second F# console application. The code goes like this:
let rec fact n =
if n = 1 then 1.0
else float(n)*fact(n-1);;
let rec pow x n =
if n = 1 then x
else float(x) * pow x (n-1);;
let rec func1 eps x n =
let f = fact (2 * n) * (fun n -> pow x n / float(n)) (2*n+1) / (pow 4.0 n * pow (fact n) 2)
if abs f < eps then f
else f + func1 eps x (n+1);;
let quarter = func1 1.0e-2 1.0 2;;
When I try to run let quarter = func1 1.0e-2 1.0 2;;, interactive console says error FS0039: The value or constructor 'func1' is not defined.
What did go wrong or what does my code lack?
Thanks in advance.
func1was not yet evaluated. Try re-evaluate all values from the beginning. - PetrAlt-Enter(or right click on the selection and chooseExecute in Interactivefrom context menu - Petr