summaryrefslogtreecommitdiff
path: root/testsuite/tests/numeric/should_run/arith013.hs
blob: a03cbb3795c72c5798d0e8afa3681d78acd4dc78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
-- Test gcdInt/gcdInteger

import GHC.Real	( gcdInt )
import GHC.Num	( gcdInteger )

main :: IO ()
main = do
   test gcdInt     [                       -42, 0, 105             ]
   test gcdInteger [-12193263111263526900, -42, 0, 105, 1234567890 ]


test :: Integral a => (a -> a -> a) -> [a] -> IO ()
test f xs = mapM_ print [ (a, b, f a b) | a <- xs, b <- reverse xs, a /= 0  || b /= 0 ]