From: simonmar Date: Mon, 13 Dec 1999 17:25:57 +0000 (+0000) Subject: [project @ 1999-12-13 17:25:57 by simonmar] X-Git-Tag: Approximately_9120_patches~5383 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=bc467a8b94c61a999ab2d7e71918f3ff549a11b7;hp=1fa4a56319ce1b5827d2101cc9fa256196517a4f;p=ghc-hetmet.git [project @ 1999-12-13 17:25:57 by simonmar] Fix bug in abs::Integer->Integer: result was wrong for minBound::Int. --- diff --git a/ghc/lib/std/PrelNum.lhs b/ghc/lib/std/PrelNum.lhs index 9cb3d55..f70f726 100644 --- a/ghc/lib/std/PrelNum.lhs +++ b/ghc/lib/std/PrelNum.lhs @@ -242,11 +242,9 @@ instance Num Integer where -- ORIG: abs n = if n >= 0 then n else -n + abs (S# (-2147483648#)) = 2147483648 abs (S# i) = case abs (I# i) of I# j -> S# j - abs n@(J# s d) - = if (cmpIntegerInt# s d 0#) >=# 0# - then n - else J# (negateInt# s) d + abs n@(J# s d) = if (s >=# 0#) then n else J# (negateInt# s) d signum (S# i) = case signum (I# i) of I# j -> S# j signum (J# s d)