From 322b11aaf66561b244b6a8d75272aab603f5e718 Mon Sep 17 00:00:00 2001 From: sof Date: Mon, 10 May 1999 19:49:16 +0000 Subject: [PATCH] [project @ 1999-05-10 19:49:15 by sof] minor updates --- ghc/tests/numeric/should_run/num002.hs | 7 +++++-- ghc/tests/numeric/should_run/num002.stdout | 2 +- ghc/tests/numeric/should_run/num003.hs | 2 +- ghc/tests/numeric/should_run/num003.stdout | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ghc/tests/numeric/should_run/num002.hs b/ghc/tests/numeric/should_run/num002.hs index 917dcab..31ea76c 100644 --- a/ghc/tests/numeric/should_run/num002.hs +++ b/ghc/tests/numeric/should_run/num002.hs @@ -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) []) diff --git a/ghc/tests/numeric/should_run/num002.stdout b/ghc/tests/numeric/should_run/num002.stdout index 902b262..ce14dec 100644 --- a/ghc/tests/numeric/should_run/num002.stdout +++ b/ghc/tests/numeric/should_run/num002.stdout @@ -1,6 +1,6 @@ 343023920121 3430239 1212 -3126284 +-3055754 -111 232189458241 diff --git a/ghc/tests/numeric/should_run/num003.hs b/ghc/tests/numeric/should_run/num003.hs index 0b8ea6b..146f0a6 100644 --- a/ghc/tests/numeric/should_run/num003.hs +++ b/ghc/tests/numeric/should_run/num003.hs @@ -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))) diff --git a/ghc/tests/numeric/should_run/num003.stdout b/ghc/tests/numeric/should_run/num003.stdout index c637f98..1266b60 100644 --- a/ghc/tests/numeric/should_run/num003.stdout +++ b/ghc/tests/numeric/should_run/num003.stdout @@ -1,6 +1,6 @@ [(343023920121,"")] [(3430239,"")] [(1212,"")] -[] -[] +[(-3055754,"")] +[(-111,"")] [(232189458241,"")] -- 1.7.10.4