summaryrefslogtreecommitdiff
path: root/testsuite/tests/numeric/should_run/numrun015.hs
blob: f0bb4292088d6147c6f3d84746492ebf4c257c58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- Test that floating-point abs works correctly

absF :: Float -> Float
absF = abs

absD :: Double -> Double
absD = abs

main :: IO ()
main = do
    print $ absF (1 / 0)
    print $ absD (1 / 0)
    print $ absF 1
    print $ absD 1
    print $ absF (-1)
    print $ absD (-1)
    print $ absF (-1 / 0)
    print $ absD (-1 / 0)
    print $ absF (0 / 0)
    print $ absD (0 / 0)
    print $ absD $ sqrt (-1)