Skip to content

Commit f15c1b8

Browse files
authored
There is only one operand for bitwise not (mdn#5210). (mdn#5306)
1 parent 2dce739 commit f15c1b8

File tree

1 file changed

+10
-14
lines changed
  • files/en-us/web/javascript/reference/operators/bitwise_not

1 file changed

+10
-14
lines changed

files/en-us/web/javascript/reference/operators/bitwise_not/index.html

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
title: Bitwise NOT (~)
33
slug: Web/JavaScript/Reference/Operators/Bitwise_NOT
44
tags:
5-
- Bitwise operator
6-
- JavaScript
7-
- Language feature
8-
- Operator
9-
- Reference
5+
- Bitwise operator
6+
- JavaScript
7+
- Language feature
8+
- Operator
9+
- Reference
1010
browser-compat: javascript.operators.bitwise_not
1111
---
1212
<div>{{jsSidebar("Operators")}}</div>
@@ -17,24 +17,20 @@
1717

1818
<h2 id="Syntax">Syntax</h2>
1919

20-
<pre class="brush: js"><code><var>~a</var></code>
20+
<pre class="brush: js">~a
2121
</pre>
2222

2323
<h2 id="Description">Description</h2>
2424

25-
<p>The operands are converted to 32-bit integers and expressed by a series of bits (zeroes
25+
<p>The operand is converted to a 32-bit integer and expressed as a series of bits (zeroes
2626
and ones). Numbers with more than 32 bits get their most significant bits discarded. For
27-
example, the following integer with more than 32 bits will be converted to a 32 bit
27+
example, the following integer, with more than 32 bits, will be converted to a 32 bit
2828
integer:</p>
2929

3030
<pre class="brush: js">Before: 11100110111110100000000000000110000000000001
3131
After: 10100000000000000110000000000001</pre>
3232

33-
<p>Each bit in the first operand is paired with the corresponding bit in the second
34-
operand: <em>first bit</em> to <em>first bit</em>, <em>second bit</em> to <em>second
35-
bit</em>, and so on.</p>
36-
37-
<p>The operator is applied to each pair of bits, and the result is constructed bitwise.
33+
<p>Each bit in the operand is inverted in the result.
3834
</p>
3935

4036
<p>The truth table for the <code>NOT</code> operation is:</p>
@@ -89,6 +85,6 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
8985
<h2 id="See_also">See also</h2>
9086

9187
<ul>
92-
<li><a href="/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Bitwise">Bitwise
88+
<li><a href="/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#bitwise">Bitwise
9389
operators in the JS guide</a></li>
9490
</ul>

0 commit comments

Comments
 (0)