Skip to content
Snippets Groups Projects
Commit b661cfa6 authored by sven.panne@aedion.de's avatar sven.panne@aedion.de
Browse files

[project @ 2000-06-05 20:54:29 by panne]

Added tests for gcdInt/gcdInteger
parent 83ba8b2c
No related branches found
No related tags found
No related merge requests found
-- Test gcdInt/gcdInteger
import PrelBase ( gcdInt )
import PrelNum ( 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 ]
(-42,105,21)
(-42,0,42)
(-42,-42,42)
(0,105,105)
(0,-42,42)
(105,105,105)
(105,0,105)
(105,-42,21)
(-12193263111263526900,1234567890,1234567890)
(-12193263111263526900,105,15)
(-12193263111263526900,0,12193263111263526900)
(-12193263111263526900,-42,6)
(-12193263111263526900,-12193263111263526900,12193263111263526900)
(-42,1234567890,6)
(-42,105,21)
(-42,0,42)
(-42,-42,42)
(-42,-12193263111263526900,6)
(0,1234567890,1234567890)
(0,105,105)
(0,-42,42)
(0,-12193263111263526900,12193263111263526900)
(105,1234567890,15)
(105,105,105)
(105,0,105)
(105,-42,21)
(105,-12193263111263526900,15)
(1234567890,1234567890,1234567890)
(1234567890,105,15)
(1234567890,0,1234567890)
(1234567890,-42,6)
(1234567890,-12193263111263526900,1234567890)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment