Press CTRL+C or CMD+C to copy the selected text and close this dialog.
Tweet
0 people like it. Like the snippet!
Calculate the value of Pi, using the Nilakantha series
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
let nPi = let piSeq = seq{ yield 3.0 let rec pi start sign = seq{ yield (sign * 4.0) / ( start * (start + 1.0) * (start + 2.0)) yield! pi (start + 2.0) (sign * -1.0) } yield! pi 2.0 1.0 } piSeq |> Seq.take 10 |> Seq.sum