[project @ 1999-05-10 19:49:15 by sof]
authorsof <unknown>
Mon, 10 May 1999 19:49:16 +0000 (19:49 +0000)
committersof <unknown>
Mon, 10 May 1999 19:49:16 +0000 (19:49 +0000)
minor updates

ghc/tests/numeric/should_run/num002.hs
ghc/tests/numeric/should_run/num002.stdout
ghc/tests/numeric/should_run/num003.hs
ghc/tests/numeric/should_run/num003.stdout

index 917dcab..31ea76c 100644 (file)
@@ -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) [])
 
index 902b262..ce14dec 100644 (file)
@@ -1,6 +1,6 @@
 343023920121
 3430239
 1212
-3126284
+-3055754
 -111
 232189458241
index 0b8ea6b..146f0a6 100644 (file)
@@ -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)))
index c637f98..1266b60 100644 (file)
@@ -1,6 +1,6 @@
 [(343023920121,"")]
 [(3430239,"")]
 [(1212,"")]
-[]
-[]
+[(-3055754,"")]
+[(-111,"")]
 [(232189458241,"")]