Commit 6b063ef2 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Make Natural's (.|.) really an OR operation (#9818)

Currently it's an AND when at least one of the operands is big.

Reviewed By: hvr

Differential Revision: https://phabricator.haskell.org/D549
parent c41d214a
......@@ -296,9 +296,9 @@ instance Bits Natural where
NatJ# n .&. NatJ# m = bigNatToNatural (andBigNat n m)
NatS# n .|. NatS# m = wordToNatural (W# n .|. W# m)
NatS# n .|. NatJ# m = NatJ# (andBigNat (wordToBigNat n) m)
NatJ# n .|. NatS# m = NatJ# (andBigNat n (wordToBigNat m))
NatJ# n .|. NatJ# m = NatJ# (andBigNat n m)
NatS# n .|. NatJ# m = NatJ# (orBigNat (wordToBigNat n) m)
NatJ# n .|. NatS# m = NatJ# (orBigNat n (wordToBigNat m))
NatJ# n .|. NatJ# m = NatJ# (orBigNat n m)
NatS# n `xor` NatS# m = wordToNatural (W# n `xor` W# m)
NatS# n `xor` NatJ# m = NatJ# (xorBigNat (wordToBigNat n) m)
......
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