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)
| 4744 | return a.logical_and(b, context=self) |
| 4745 | |
| 4746 | def logical_invert(self, a): |
| 4747 | """Invert all the digits in the operand. |
| 4748 | |
| 4749 | The operand must be a logical number. |
| 4750 | |
| 4751 | >>> ExtendedContext.logical_invert(Decimal('0')) |
| 4752 | Decimal('111111111') |
| 4753 | >>> ExtendedContext.logical_invert(Decimal('1')) |
| 4754 | Decimal('111111110') |
| 4755 | >>> ExtendedContext.logical_invert(Decimal('111111111')) |
| 4756 | Decimal('0') |
| 4757 | >>> ExtendedContext.logical_invert(Decimal('101010101')) |
| 4758 | Decimal('10101010') |
| 4759 | >>> ExtendedContext.logical_invert(1101) |
| 4760 | Decimal('111110010') |
| 4761 | """ |
| 4762 | a = _convert_other(a, raiseit=True) |
| 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. |