[project @ 1999-02-19 10:48:58 by simonm]
authorsimonm <unknown>
Fri, 19 Feb 1999 10:48:58 +0000 (10:48 +0000)
committersimonm <unknown>
Fri, 19 Feb 1999 10:48:58 +0000 (10:48 +0000)
Fix negate (toInteger (minBound :: Int)).

ghc/lib/std/PrelNum.lhs

index b092c9b..96dc994 100644 (file)
@@ -242,6 +242,7 @@ instance  Num Integer  where
     (*) (J# s1 d1) (J# s2 d2)
       = case timesInteger# s1 d1 s2 d2 of (# s, d #) -> J# s d
 
+    negate i@(S# (-2147483648#)) = 2147483648
     negate (S# i) = S# (negateInt# i)
     negate (J# s d) = J# (negateInt# s) d