Project 'el7g15/uos-latex-template' was moved to 'uos-latex-group/uos-latex-template'. Please update any links and bookmarks that may still have the old path.
Select Git revision
ecsdocs.dtx
-
Edward Longman authoredEdward Longman authored
exA2.hs 223 B
approxPi :: Int -> Double
approxPi n | n <= 0 = error "negative numbers or 0 cannot be used for approximations of pi"
| otherwise = 2 * sum [product [1..a] / product [1,3..2 * a + 1] | a <- [0..fromIntegral n-1]]