summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/Numeric/num003.hs
blob: 368be2599ae5b3125cafdde8bec49e65b40de2d8 (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)))