Commit 322b11aa authored by sof's avatar sof
Browse files

[project @ 1999-05-10 19:49:15 by sof]

minor updates
parent 88bab0e7
......@@ -4,14 +4,17 @@ module Main(main) where
import Numeric
showSignedInt :: Integral a => a -> String
showSignedInt x = showSigned (showInt) 0 x ""
main =
do
putStrLn (showInt (343023920121::Integer) [])
putStrLn (showInt (3430239::Int) [])
putStrLn (showInt (1212 :: Int) [])
putStrLn (showInt (5911256624 `div` (517::Int)) [])
putStrLn (showSignedInt (591125662431 `div` (517::Int)))
-- showInt just works over naturals, wrap it up inside
-- a use of Numeric.showSigned to show negative nums.
putStrLn (showSigned (showInt) 0 (-111::Int) [])
putStrLn (showSignedInt (-111::Int))
putStrLn (showInt (232189458241::Integer) [])
343023920121
3430239
1212
3126284
-3055754
-111
232189458241
......@@ -8,7 +8,7 @@ import Char
main =
let
rd :: ReadS Integer
rd = readInt 10 (isDigit) (digitToInt)
rd = readSigned (readInt 10 (isDigit) (digitToInt))
in
do
print (rd (show (343023920121::Integer)))
......
[(343023920121,"")]
[(3430239,"")]
[(1212,"")]
[]
[]
[(-3055754,"")]
[(-111,"")]
[(232189458241,"")]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment