aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/javascript/reference/operators/bitwise_and
diff options
context:
space:
mode:
authorSphinxKnight <SphinxKnight@users.noreply.github.com>2021-06-27 15:03:56 +0200
committerGitHub <noreply@github.com>2021-06-27 15:03:56 +0200
commit9f030ef5fd3a0dc15d94c01d0e1bbd1aba1eed54 (patch)
treee6aa6c44ea4c523dbf72464e77745bed1efc8c51 /files/fr/web/javascript/reference/operators/bitwise_and
parentdc9842009bd95e0db7e058a5ebb98f27d6a3f650 (diff)
downloadtranslated-content-9f030ef5fd3a0dc15d94c01d0e1bbd1aba1eed54.tar.gz
translated-content-9f030ef5fd3a0dc15d94c01d0e1bbd1aba1eed54.tar.bz2
translated-content-9f030ef5fd3a0dc15d94c01d0e1bbd1aba1eed54.zip
Fix #756 by updating the JS operators in fr (#1306)
* Update Operators landing + revamp L10N for 4 operators * Added NOT / ! - * +multiplication * Addition, exponentiation and comparison * Operateurs de comparaison * Binary ops * Missing newline, thx GH UI * Logical AND / OR * Assignment ops * Conflicting clean-up * Missing EOF newline * Fix history and redirects * FIX: fix flaws * FIX: minox typo fix * FIX: link flaws * FIX: fix tags detection Co-authored-by: tristantheb <tristantheb@gmail.com>
Diffstat (limited to 'files/fr/web/javascript/reference/operators/bitwise_and')
-rw-r--r--files/fr/web/javascript/reference/operators/bitwise_and/index.html102
1 files changed, 102 insertions, 0 deletions
diff --git a/files/fr/web/javascript/reference/operators/bitwise_and/index.html b/files/fr/web/javascript/reference/operators/bitwise_and/index.html
new file mode 100644
index 0000000000..b1a3ca024b
--- /dev/null
+++ b/files/fr/web/javascript/reference/operators/bitwise_and/index.html
@@ -0,0 +1,102 @@
+---
+title: ET binaire (&)
+slug: Web/JavaScript/Reference/Operators/Bitwise_AND
+tags:
+ - Bitwise operator
+ - JavaScript
+ - Language feature
+ - Operator
+ - Reference
+browser-compat: javascript.operators.bitwise_and
+translation-of: Web/JavaScript/Reference/Operators/Bitwise_AND
+---
+<div>{{jsSidebar("Operators")}}</div>
+
+<p>L'opérateur ET binaire (<code>&amp;</code>) renvoie un nombre dont la représentation binaire est une séquence de bits où il y a un <code>1</code> pour chaque position où les bits des deux opérandes valent <code>1</code>.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/expressions-bitwise-and.html")}}</div>
+
+<h2 id="syntax">Syntaxe</h2>
+
+<pre class="brush: js">
+<var>a</var> &amp; <var>b</var>
+</pre>
+
+<h2 id="description">Description</h2>
+
+<p>Les opérandes sont convertis en entiers sur 32 bits et exprimés comme une séquence de bits. Les nombres sur plus de 32 bits ont leurs bits en excès écartés. Par exemple, l'entier suivant nécessite plus de 32 bits pour être représenté et il sera converti en un entier sur 32 bits :</p>
+
+<pre class="brush: js">
+Avant: 11100110111110100000000000000110000000000001
+Après: 10100000000000000110000000000001
+</pre>
+
+<p>Chaque bit du premier opérande est associé avec le bit correspondant du second opérande. Lorsque les deux valent 1, le bit correspondant du résultat sera placé à 1. Le résultat est donc construit binairement.</p>
+
+<p>La table de vérité pour l'opérateur ET est :</p>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th class="header" scope="col">a</th>
+ <th class="header" scope="col">b</th>
+ <th class="header" scope="col">a ET b</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>0</td>
+ <td>0</td>
+ <td>0</td>
+ </tr>
+ <tr>
+ <td>0</td>
+ <td>1</td>
+ <td>0</td>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>0</td>
+ <td>0</td>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>1</td>
+ <td>1</td>
+ </tr>
+ </tbody>
+</table>
+
+<pre class="brush: js">
+ 9 (base 10) = 00000000000000000000000000001001 (base 2)
+ 14 (base 10) = 00000000000000000000000000001110 (base 2)
+ --------------------------------
+14 &amp; 9 (base 10) = 00000000000000000000000000001000 (base 2) = 8 (base 10)
+</pre>
+
+<p>Utiliser un ET binaire sur n'importe quel nombre <code><var>x</var></code> d'une part et <code>0</code> d'autre part renverra <code>0</code>.</p>
+
+<h2 id="examples">Exemples</h2>
+
+<h3 id="using_bitwise_and">Utiliser l'opérateur ET binaire</h3>
+
+<pre class="brush: js">
+// 5: 00000000000000000000000000000101
+// 2: 00000000000000000000000000000010
+5 &amp; 2; // 0
+</pre>
+
+<h2 id="specifications">Spécifications</h2>
+
+<p>{{Specifications}}</p>
+
+<h2 id="browser_compatibility">Compatibilité des navigateurs</h2>
+
+<p>{{Compat}}</p>
+
+<h2 id="see_also">Voir aussi</h2>
+
+<ul>
+ <li><a href="/fr/docs/Web/JavaScript/Guide/Expressions_and_Operators#bitwise">Les opérateurs binaires dans le guide JavaScript</a></li>
+ <li><a href="/fr/docs/Web/JavaScript/Reference/Operators/Bitwise_AND_assignment">L'opérateur ET binaire et d'affectation</a></li>
+</ul>