summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/Numeric/num010.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/lib/Numeric/num010.hs')
-rw-r--r--testsuite/tests/lib/Numeric/num010.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/lib/Numeric/num010.hs b/testsuite/tests/lib/Numeric/num010.hs
new file mode 100644
index 0000000000..bf1d5a2734
--- /dev/null
+++ b/testsuite/tests/lib/Numeric/num010.hs
@@ -0,0 +1,29 @@
+
+module Main(main) where
+
+main = sequence_ [ f x y | x <- [0,
+ 1000,
+ 1000000000000, -- > 2^32
+ 1000000000000000000000000, -- > 2^64
+ -1000,
+ -1000000000000, -- < -2^32
+ -1000000000000000000000000] -- < -2^64
+ , y <- [0, -10, 10] ]
+
+f :: Integer -> Int -> IO ()
+f x y = do putStrLn "------------------------"
+ print x
+ print y
+ let d :: Double
+ d = encodeFloat x y
+ (xd, yd) = decodeFloat d
+ let f :: Float
+ f = encodeFloat x y
+ (xf, yf) = decodeFloat f
+ print d
+ print xd
+ print yd
+ print f
+ print xf
+ print yf
+