1 --!!! test quot/rem/div/mod functions on Ints and Integers
5 (-- w/ Ints and Integers
6 show (unzipWith div ints_list)
8 ++ show (unzipWith div integers_list)
10 ++ show (unzipWith rem ints_list)
12 ++ show (unzipWith rem integers_list)
14 ++ show (unzipWith quot ints_list)
16 ++ show (unzipWith quot integers_list)
18 ++ show (unzipWith mod ints_list)
20 ++ show (unzipWith mod integers_list)
22 ++ show (unzipWith law1 ints_list)
24 ++ show (unzipWith law1 integers_list)
26 ++ show (unzipWith law2 ints_list)
28 ++ show (unzipWith law2 integers_list)
32 ints_list :: [(Int, Int)]
33 integers_list :: [(Integer, Integer)]
75 (12345678900,500000000),
76 (1234000000000000000000005678900,5001111111111111000000)
79 unzipWith :: (a -> b -> c) -> [(a,b)] -> [c]
81 unzipWith f ((x,y):zs) = f x y : unzipWith f zs
83 law1, law2 :: Integral a => a -> a -> Bool
85 law1 x y = (x `quot` y)*y + (x `rem` y) == x
86 law2 x y = (x `div` y)*y + (x `mod` y) == x