Gunakan tanda [] untuk mencari tag gan! contoh [flutter, javascript]

Pemrograman Dart - Operator Bitwise

Pemrograman Dart - Operator Bitwise

Artikel ini dibukukan pada buku Pemrograman Dasar Dart
access_time 30 Mei 2021 remove_red_eye 1847 Kali spellcheck 666 Kata, 1655 Karakter
#dart #operator dart #bitwise

Bitwise is a designated operator in a programming language that manipulates the individual bits in a byte or word. This is very rarely used in programming, but if you can find out, maybe it can be your shortcut in getting things done

Cheat Sheet


Operators Description
&

AND

example:

a & b

Returns one at each bit position where the corresponding bit of both operands is one.

|

OR

example:

a | b

Returns one at each bit position where the corresponding bit of either or both operands is one.

^

XOR

example:

a ^ b

Returns one at each bit position where the corresponding bit of one but not both operands is one.

~

NOT

example:

~a

Inverts the operand bits.

<<

Left Shift

a << b

Shifts a in binary representation b (<32) bits to the left, shifts zeros from the right.

>>

Sign propagating right shift

a >> b

Shifting a in binary representation b(<32) bits to the right, the discarded bit shifts.


Example of Use

if the snippet below doesn't work, please open this snippet



Artikel ini dibukukan pada buku Pemrograman Dasar Dart
Navigasi Konten