Applies the logical operation 'xor' between each operand's digits. The operands must be both logical numbers. >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0')) Decimal('0') >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1')) Decimal('1')
(self, a, b)
| 4787 | return a.logical_or(b, context=self) |
| 4788 | |
| 4789 | def logical_xor(self, a, b): |
| 4790 | """Applies the logical operation 'xor' between each operand's digits. |
| 4791 | |
| 4792 | The operands must be both logical numbers. |
| 4793 | |
| 4794 | >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0')) |
| 4795 | Decimal('0') |
| 4796 | >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1')) |
| 4797 | Decimal('1') |
| 4798 | >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0')) |
| 4799 | Decimal('1') |
| 4800 | >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1')) |
| 4801 | Decimal('0') |
| 4802 | >>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010')) |
| 4803 | Decimal('110') |
| 4804 | >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10')) |
| 4805 | Decimal('1101') |
| 4806 | >>> ExtendedContext.logical_xor(110, 1101) |
| 4807 | Decimal('1011') |
| 4808 | >>> ExtendedContext.logical_xor(Decimal(110), 1101) |
| 4809 | Decimal('1011') |
| 4810 | >>> ExtendedContext.logical_xor(110, Decimal(1101)) |
| 4811 | Decimal('1011') |
| 4812 | """ |
| 4813 | a = _convert_other(a, raiseit=True) |
| 4814 | return a.logical_xor(b, context=self) |
| 4815 | |
| 4816 | def max(self, a, b): |
| 4817 | """max compares two values numerically and returns the maximum. |