MCPcopy Index your code
hub / github.com/RustPython/RustPython / logical_invert

Method logical_invert

Lib/_pydecimal.py:4743–4760  ·  view source on GitHub ↗

Invert all the digits in the operand. The operand must be a logical number. >>> ExtendedContext.logical_invert(Decimal('0')) Decimal('111111111') >>> ExtendedContext.logical_invert(Decimal('1')) Decimal('111111110') >>> ExtendedContext.logical_invert

(self, a)

Source from the content-addressed store, hash-verified

4741 return a.logical_and(b, context=self)
4742
4743 def logical_invert(self, a):
4744 """Invert all the digits in the operand.
4745
4746 The operand must be a logical number.
4747
4748 >>> ExtendedContext.logical_invert(Decimal('0'))
4749 Decimal('111111111')
4750 >>> ExtendedContext.logical_invert(Decimal('1'))
4751 Decimal('111111110')
4752 >>> ExtendedContext.logical_invert(Decimal('111111111'))
4753 Decimal('0')
4754 >>> ExtendedContext.logical_invert(Decimal('101010101'))
4755 Decimal('10101010')
4756 >>> ExtendedContext.logical_invert(1101)
4757 Decimal('111110010')
4758 """
4759 a = _convert_other(a, raiseit=True)
4760 return a.logical_invert(context=self)
4761
4762 def logical_or(self, a, b):
4763 """Applies the logical operation 'or' between each operand's digits.

Callers 1

test_logical_invertMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
logical_invertMethod · 0.45

Tested by 1

test_logical_invertMethod · 0.76