operator | method

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

Bit-wise 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 either of this and other

If both operands are non-negative, 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}');
  }
}