MCPcopy Index your code
hub / github.com/python/cpython / check_bitop_identities_2

Method check_bitop_identities_2

Lib/test/test_long.py:259–270  ·  view source on GitHub ↗
(self, x, y)

Source from the content-addressed store, hash-verified

257 eq(x & -p2, x & ~(p2 - 1))
258
259 def check_bitop_identities_2(self, x, y):
260 eq = self.assertEqual
261 with self.subTest(x=x, y=y):
262 eq(x & y, y & x)
263 eq(x | y, y | x)
264 eq(x ^ y, y ^ x)
265 eq(x ^ y ^ x, y)
266 eq(x & y, ~(~x | ~y))
267 eq(x | y, ~(~x & ~y))
268 eq(x ^ y, (x | y) & ~(x & y))
269 eq(x ^ y, (x & ~y) | (~x & y))
270 eq(x ^ y, (x | y) & (~x | ~y))
271
272 def check_bitop_identities_3(self, x, y, z):
273 eq = self.assertEqual

Callers 1

test_bitop_identitiesMethod · 0.95

Calls 2

eqFunction · 0.85
subTestMethod · 0.45

Tested by

no test coverage detected