[ create a new paste ] login | about

Link: http://codepad.org/gJREKYA0    [ raw code | output | fork ]

Haskell, pasted on Dec 7:
1
2
3
4
5
import Data.Function
main :: IO ()
main = print $ f 200 100
f :: Double -> Double -> Integer
f n m = round $ ((+) `on` sum ) =<< tail $ zipWith  (*) ((2 * pi / 3) : repeat (5 * pi / 3)) $ takeWhile (> 0) $ iterate (+ (- m)) n


Output:
1
2
Error occurred
ERROR "t.hs" - Can't find imported module "Data.Function"


Create a new paste based on this one


Comments: