[project @ 2001-03-29 14:35:20 by simonmar]
[ghc-hetmet.git] / ghc / tests / numeric / should_run / arith013.hs
1 -- Test gcdInt/gcdInteger
2
3 import PrelBase ( gcdInt )
4 import PrelNum  ( gcdInteger )
5
6 main :: IO ()
7 main = do
8    test gcdInt     [                       -42, 0, 105             ]
9    test gcdInteger [-12193263111263526900, -42, 0, 105, 1234567890 ]
10
11
12 test :: Integral a => (a -> a -> a) -> [a] -> IO ()
13 test f xs = mapM_ print [ (a, b, f a b) | a <- xs, b <- reverse xs, a /= 0  || b /= 0 ]