Dart BigInt operator-bitwise-and
Syntax & Examples
BigInt.operator-bitwise-and operator
The `operator &` in Dart performs a bitwise AND operation between two BigInt objects.
Syntax of BigInt.operator-bitwise-and
The syntax of BigInt.operator-bitwise-and operator is:
operator &(BigInt other) → BigIntThis operator-bitwise-and operator of BigInt bit-wise and operator.
Parameters
| Parameter | Optional/Required | Description |
|---|---|---|
other | required | the BigInt object to perform the AND operation with |
✐ Example
1 Perform Bitwise AND
In this example,
- We create two BigInt objects,
num1andnum2, initialized with values 10 and 6, respectively. - We use the
&operator to perform a bitwise AND operation betweennum1andnum2. - We print the result to standard output.
Dart Program
void main() {
BigInt num1 = BigInt.from(10);
BigInt num2 = BigInt.from(6);
BigInt result = num1 & num2;
print('Bitwise AND result: $result');
}Output
Bitwise AND result: 2
Summary
In this Dart tutorial, we learned about operator-bitwise-and operator of BigInt: the syntax and few working examples with output and detailed explanation for each example.