Update 2024-02-14 07:51 OpenBSD/amd64-x13
This commit is contained in:
15
.bin/OLD/bitshift
Executable file
15
.bin/OLD/bitshift
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/cat
|
||||
|
||||
+-----+-----+-----+-----+-----+
|
||||
| x | y | x&y | x|y | x^y |
|
||||
+-----+-----+-----+-----+-----+
|
||||
| 0 | 0 | 0 | 0 | 0 |
|
||||
| 0 | 1 | 0 | 1 | 1 |
|
||||
| 1 | 0 | 0 | 1 | 1 |
|
||||
| 1 | 1 | 1 | 1 | 0 |
|
||||
+-----+-----+-----+-----+-----+
|
||||
|
||||
x&y = 1 when: both need to be 1
|
||||
x|y = 1 when: one or both needs to be 1
|
||||
x^y = 1 when: x and y are different
|
||||
|
||||
Reference in New Issue
Block a user