<p>Next on the list of logical operators is the <strong>not equal to</strong> operator <span class="math inline">\(!=\)</span> which, as with all the others, does what it says it does. It returns a value of TRUE when things on either side are not identical to each other. Therefore, since <span class="math inline">\(2 + 2\)</span> isn’t equal to <span class="math inline">\(5\)</span>, we would get “true” as the value for our newly computed variable. Try it and see: <span class="math display">\[2 + 2 \text{ != } 5\]</span> We’re not quite done yet. There are three more logical operations that are worth knowing about, listed in <a href="#tbl-tab6-3" class="quarto-xref">Table <span>6.3</span></a>. These are the <strong>not</strong> operator <span class="math inline">\(!\)</span>, the <strong>and</strong> operator <span class="math inline">\(and\)</span>, and the <strong>or</strong> operator <span class="math inline">\(or\)</span>. Like the other logical operators, their behaviour is more or less exactly what you’d expect given their names. For instance, if I ask you to assess the claim that “either <span class="math inline">\(2 + 2 = 4\)</span> or <span class="math inline">\(2 + 2 = 5\)</span>” you’d say that it’s true. Since it’s an “either-or” statement, all we need is for one of the two parts to be true. That’s what the <span class="math inline">\(or\)</span> operator does.<a href="#fn5" class="footnote-ref" id="fnref5" role="doc-noteref"><sup>5</sup></a></p>
0 commit comments