Skip to content
Snippets Groups Projects
Select Git revision
  • 94a623c9cec423be1065d9a2d064f3837ba5c45c
  • master default protected
2 results

exA2.hs

Blame
  • 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]]