Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
bc467a8b
Commit
bc467a8b
authored
Dec 13, 1999
by
simonmar
Browse files
[project @ 1999-12-13 17:25:57 by simonmar]
Fix bug in abs::Integer->Integer: result was wrong for minBound::Int.
parent
1fa4a563
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/lib/std/PrelNum.lhs
View file @
bc467a8b
...
...
@@ -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)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment