operator & method

  1. @override
u4 operator &(
  1. dynamic other
)
override

Bit-wise and operator.

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

If both operands are negative, the result is negative, otherwise the result is non-negative.

Returns u4

Implementation

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