Commit 54fccb52 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Use testBitInteger; part of #3489. patch from pumpkingod@gmail.com

parent 855ef734
......@@ -386,6 +386,7 @@ instance Bits Integer where
complement = complementInteger
shift x i@(I# i#) | i >= 0 = shiftLInteger x i#
| otherwise = shiftRInteger x (negateInt# i#)
testBit x (I# i) = testBitInteger x i
#else
-- reduce bitwise binary operations to special cases we can handle
......@@ -404,10 +405,10 @@ instance Bits Integer where
complement a = -1 - a
shift x i | i >= 0 = x * 2^i
| otherwise = x `div` 2^(-i)
testBit = testBitDefault
#endif
bit = bitDefault
testBit = testBitDefault
popCount = popCountDefault
rotate x i = shift x i -- since an Integer never wraps around
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment