summaryrefslogtreecommitdiff
path: root/libraries/base/tests/Numeric/num003.hs
blob: 01ca4926a53e959cc935536a20a4b3013d064f38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- Testing readInt, lightly.
--
module Main(main) where

import Numeric
import Data.Char

main =
  let
   rd :: ReadS Integer
   rd = readSigned (readInt 10 (isDigit) (digitToInt))
  in
  do
   print (rd (show (343023920121::Integer)))
   print (rd (show (3430239::Int)))
   print (rd (show (1212 :: Int)))
   print (rd (show (591125662431 `div` (517::Int))))
   print (rd (show (-111::Int)))
   print (rd (show (232189458241::Integer)))