Arithmetic/Integer: Difference between revisions

Content added Content deleted
Line 292: Line 292:
putStrLn $ "a - b = " ++ show (a - b)
putStrLn $ "a - b = " ++ show (a - b)
putStrLn $ "a * b = " ++ show (a * b)
putStrLn $ "a * b = " ++ show (a * b)
putStrLn $ "a to the power of b = " ++ show (a ** b)
putStrLn $ "a to the power of b = " ++ show (a ^ b)
putStrLn $ "a to the power of b = " ++ show (a ^^ b)
putStrLn $ "a `div` b = " ++ show (a `div` b) -- truncates towards negative infinity
putStrLn $ "a `div` b = " ++ show (a `div` b) -- truncates towards negative infinity
putStrLn $ "a `mod` b = " ++ show (a `mod` b) -- same sign as second operand
putStrLn $ "a `mod` b = " ++ show (a `mod` b) -- same sign as second operand