|
@ -631,7 +631,7 @@ to_exclusive = <range>.stop |
|
|
<div><h3 id="bitwiseoperators">Bitwise Operators</h3><pre><code class="python language-python hljs"><int> = <int> & <int> <span class="hljs-comment"># And</span> |
|
|
<div><h3 id="bitwiseoperators">Bitwise Operators</h3><pre><code class="python language-python hljs"><int> = <int> & <int> <span class="hljs-comment"># And</span> |
|
|
<int> = <int> | <int> <span class="hljs-comment"># Or</span> |
|
|
<int> = <int> | <int> <span class="hljs-comment"># Or</span> |
|
|
<int> = <int> ^ <int> <span class="hljs-comment"># Xor (0 if both bits equal)</span> |
|
|
<int> = <int> ^ <int> <span class="hljs-comment"># Xor (0 if both bits equal)</span> |
|
|
<int> = <int> << n_bits <span class="hljs-comment"># Shift left (>> for right)</span> |
|
|
<int> = <int> << n_bits <span class="hljs-comment"># Left shift (>> for right)</span> |
|
|
<int> = ~<int> <span class="hljs-comment"># Not (also: -<int> - 1)</span> |
|
|
<int> = ~<int> <span class="hljs-comment"># Not (also: -<int> - 1)</span> |
|
|
</code></pre></div> |
|
|
</code></pre></div> |
|
|
|
|
|
|
|
|
xxxxxxxxxx