[project @ 2001-04-06 04:28:53 by lewie]
[ghc-hetmet.git] / ghc / tests / numeric / should_run / num002.hs
1 -- Testing showInt, lightly.
2
3 module Main(main) where
4
5 import Numeric
6
7 showSignedInt :: Integral a => a -> String
8 showSignedInt x = showSigned (showInt) 0 x ""
9
10 main = 
11   do
12    putStrLn (showInt (343023920121::Integer) [])
13    putStrLn (showInt (3430239::Int) [])
14    putStrLn (showInt (1212 :: Int) [])
15    putStrLn (showSignedInt (591125662431 `div` (517::Int)))
16    -- showInt just works over naturals, wrap it up inside
17    -- a use of Numeric.showSigned to show negative nums.
18    putStrLn (showSignedInt (-111::Int))
19    putStrLn (showInt (232189458241::Integer) [])
20