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

Method logical_or

Lib/_pydecimal.py:4765–4790  ·  view source on GitHub ↗

Applies the logical operation 'or' between each operand's digits. The operands must be both logical numbers. >>> ExtendedContext.logical_or(Decimal('0'), Decimal('0')) Decimal('0') >>> ExtendedContext.logical_or(Decimal('0'), Decimal('1')) Decimal('1')

(self, a, b)

Source from the content-addressed store, hash-verified

4763 return a.logical_invert(context=self)
4764
4765 def logical_or(self, a, b):
4766 """Applies the logical operation 'or' between each operand's digits.
4767
4768 The operands must be both logical numbers.
4769
4770 >>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))
4771 Decimal('0')
4772 >>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))
4773 Decimal('1')
4774 >>> ExtendedContext.logical_or(Decimal('1'), Decimal('0'))
4775 Decimal('1')
4776 >>> ExtendedContext.logical_or(Decimal('1'), Decimal('1'))
4777 Decimal('1')
4778 >>> ExtendedContext.logical_or(Decimal('1100'), Decimal('1010'))
4779 Decimal('1110')
4780 >>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10'))
4781 Decimal('1110')
4782 >>> ExtendedContext.logical_or(110, 1101)
4783 Decimal('1111')
4784 >>> ExtendedContext.logical_or(Decimal(110), 1101)
4785 Decimal('1111')
4786 >>> ExtendedContext.logical_or(110, Decimal(1101))
4787 Decimal('1111')
4788 """
4789 a = _convert_other(a, raiseit=True)
4790 return a.logical_or(b, context=self)
4791
4792 def logical_xor(self, a, b):
4793 """Applies the logical operation 'xor' between each operand's digits.

Callers 1

test_logical_orMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
logical_orMethod · 0.45

Tested by 1

test_logical_orMethod · 0.76