Skip to content

Instantly share code, notes, and snippets.

@cohalz
Created January 19, 2014 16:11
Show Gist options
  • Save cohalz/8506978 to your computer and use it in GitHub Desktop.
Save cohalz/8506978 to your computer and use it in GitHub Desktop.
let pos n =
let rec neg(n, k,i) =
if(n-k < 0) then 0.0
else if i mod 2 = 0 then neg(n,k+1,i+1) +. 1.0 /. float_of_int(4* (n-k) + 1)
else neg(n,k,i+1) -. 1.0 /. (float_of_int(4*(n-k)+3)) in
neg(n,0,0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment