Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $a = 2; // represent: 0000010
- $b = 1; // represent: 0000001 <-- kosong didepan ialah indikator positif
- // bitwise and
- echo $a & $b; // output: 0 sebab kedua-duanya tidak ada nilai 1 pada tempat yang sama
- // 10 (binary)
- // 01 (binary)
- // --
- // 00 < equivalent to 0
- // bitwise not
- echo ~$a; // output: -3 sebab 00010 inverse ialah 11101
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement