operator ^ method

  1. @override
i32 operator ^(
  1. dynamic other
)
override

Bit-wise exclusive-or operator.

Treating both this and other as sufficiently large two's component integers, the result is a number with the bits set that are set in one, but not both, of this and other

If the operands have the same sign, the result is non-negative, otherwise the result is negative.

Returns i32

Implementation

@override
i32 operator ^(dynamic other) {
  if (other is integer) {
    return i32(value ^ other.value);
  } else if (other is int) {
    return i32(value ^ other);
  } else {
    throw Exception('Invalid type for operand: ${other.runtimeType}');
  }
}