PageSourceSearch

https://hissab.io/assets/bitwise-DmkIW5dy.js

js hissab.io collected 2026-10-04 11:08:05 UTC 1,090 bytes, 57 lines download raw bytes

1var e=`# Bitwise operations
2
3Bitwise operators work on integer values regardless of whether the value is
4written in decimal, binary, octal, or hex.
5
6## Operators
7
8- **NOT** — \`~0b011010\`
9- **AND** — \`123123 & 0b100101\`
10- **OR** — \`0b1011010 | 0x123abe23\`
11- **XOR** — \`0o1024123 xor 0b0101101001\`
12- **Right shift** — \`12342 >> 5\`
13- **Left shift** — \`72318379 << 3\`
14
15\`\`\`hissab
16~0b011010
17123123 & 0b100101
180b1011010 | 0x123abe23
190o1024123 xor 0b0101101001
2012342 >> 5
2172318379 << 3
22\`\`\`
23
24## Examples
25
26\`\`\`hissab
270xff & 0x0f
280x1234 xor 0xff
291 << 8
30\`\`\`
31
32:::note
33
34Output formatting usually inherits the **left operand's base**. Append a base
35conversion when you want another format.
36
37:::
38
39\`\`\`hissab
400xff & 0x0f to decimal
41\`\`\`
42
43## Common mistakes
44
45:::caution
46
47- Use **\`&\`** and **\`|\`** for bitwise AND and OR — the words \`and\` and \`or\` are
48  not the operators.
49- **\`5 ^ 3\`** is exponentiation, not XOR. Use \`5 xor 3\`.
50- **\`~\`** is the only prefix bitwise operator; the rest are infix.
51
52:::
53
54\`\`\`hissab
555 xor 3
56\`\`\`
57`;export{e as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.