PyDocs

Nav

Numeric and Mathematical Modules

Context.logical_xor

decimal

method of Context
  • Context.logical_xor(x, y, /)
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')
    >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0'))
    Decimal('1')
    >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1'))
    Decimal('0')
    >>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010'))
    Decimal('110')
    >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10'))
    Decimal('1101')
    >>> ExtendedContext.logical_xor(110, 1101)
    Decimal('1011')
    >>> ExtendedContext.logical_xor(Decimal(110), 1101)
    Decimal('1011')
    >>> ExtendedContext.logical_xor(110, Decimal(1101))
    Decimal('1011')
0 Examples
No examples for decimal/Context.logical_xor.
See Also
No see-alsos for decimal/Context.logical_xor
0 Notes
No notes for Context.logical_xor