summaryrefslogtreecommitdiff
path: root/libraries/base/tests/Numeric/num006.hs
blob: 56b8a568f7cdd587914b39612e14d0d4635fc575 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- Exercising the showing of positive numbers at various bases.
--
module Main(main) where

import Numeric
import Data.Char

--showDec :: Integral a => a -> ShowS
showDec = showInt
main =
 do
  print (map (\ x -> showOct x []) [1..32])
  print (map (\ x -> showDec x []) [1..32])
  print (map (\ x -> showHex x []) [1..32])
  print (map (\ x -> showBin x []) [1..32])
  putStrLn (showOct (241324784::Int) [])
  putStrLn (showDec (241324784::Int) [])
  putStrLn (showHex (241324784::Int) [])
  putStrLn (showBin (241324784::Int) [])