summaryrefslogtreecommitdiff
path: root/libraries/base/tests/Numeric/num004.hs
blob: 815998819dea99b14d134b8742c736ef77b577c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- Exercising Numeric.readSigned a bit
--
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 (-0 :: Int)))
   print (rd (show (591125662431 `div` (517::Int))))
   print (rd (show (-111::Int)))
   print (rd (show (232189458241::Integer)))