how-to-do-bitwise-operations-in-dart

How to do Bitwise operations in Dart

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "how-to-do-bitwise-operations-in-dart" with this command: npx skills add rodydavis/skills/rodydavis-skills-how-to-do-bitwise-operations-in-dart

How to do Bitwise operations in Dart

In Dart it is possible to do Bitwise Operations with int and bool types.

AND 

Checks if the left and right side are both true. Learn more.

// int print(0 & 1); // 0 print(1 & 0); // 0 print(1 & 1); // 1 print(0 & 0); // 0

// bool print(false & true); // false print(true & false); // false print(true & true); // true print(false & false); // false

OR 

Inclusive 

Checks if either the left or right side are true. Learn more.

// int print(0 | 1); // 1 print(1 | 0); // 1 print(1 | 1); // 1 print(0 | 0); // 0

// bool print(false | true); // true print(true | false); // true print(true | true); // true print(false | false); // false

Exclusive 

Checks if both the left or right side are true but not both. Learn more.

// int print(0 ^ 1); // 1 print(1 ^ 0); // 1 print(1 ^ 1); // 0 print(0 ^ 0); // 0

// bool print(false ^ true); // true print(true ^ false); // true print(true ^ true); // false print(false ^ false); // false

NAND 

Negated AND operation.

// int print((0 & 1) & 1); // 1 print((1 & 0) & 1); // 1 print((1 & 1) & 1); // 0 print((0 & 0) & 1); // 1

// bool print(!(false & true)); // true print(!(true & false)); // true print(!(true & true)); // false print(!(false & false)); // true

NOR 

Negated inclusive OR operation.

// int print((0 | 1) & 1); // 0 print((1 | 0) & 1); // 0 print((1 | 1) & 1); // 0 print((0 | 0) & 1); // 1

// bool print(!(false | true)); // false print(!(true | false)); // false print(!(true | true)); // false print(!(false | false)); // true

XNOR 

Negated exclusive OR operation.

// int print((0 ^ 1) & 1); // 0 print((1 ^ 0) & 1); // 0 print((1 ^ 1) & 1); // 1 print((0 ^ 0) & 1); // 1

// bool print(!(false ^ true)); // false print(!(true ^ false)); // false print(!(true ^ true)); // true print(!(false ^ false)); // true

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

flutter-control-and-screenshot

No summary provided by upstream source.

Repository SourceNeeds Review
General

install-flutter-from-git

No summary provided by upstream source.

Repository SourceNeeds Review
General

how-to-build-a-native-cross-platform-project-with-flutter

No summary provided by upstream source.

Repository SourceNeeds Review
General

how-to-build-a-webrtc-signal-server-with-pocketbase

No summary provided by upstream source.

Repository SourceNeeds Review