<doc>
  <legacy_id>1951</legacy_id>
  <name>bitAnd</name>
  <type>operator</type>
  <syntax>
    <example><i>number1</i> bitAnd <i>number2</i></example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Math, Logic, &amp; Dates</category>
  </classification>
  <references>
    <operator tag="bitNot">bitNot Operator</operator>
    <operator tag="and">and Operator</operator>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Performs a "bitwise and" <glossary tag="operation">operation</glossary> on the <glossary tag="binary">binary</glossary> representation of two numbers.</summary>
  <examples>
    <example>0 bitAnd 1 <code><i>-- evaluates to 0</i></code></example>
    <example>3 bitAnd 2 <code><i>-- in binary: 11 bitAnd 10; evaluates to 10; converted to 2</i></code></example>
  </examples>
  <description>
    <p>Use the <b>bitAnd</b> <glossary tag="operator">operator</glossary> to operate directly on the <glossary tag="bit">bits</glossary> of two numbers.</p><p/><p><b>Parameters:</b></p><p>The <i>number1</i> and <i>number2</i> are numbers, or <glossary tag="expression">expressions</glossary> that <glossary tag="evaluate">evaluate</glossary> to numbers, between zero and 4,294,967,295 (2^32 - 1).</p><p/><p><b>Comments:</b></p><p>To perform the <b>bitAnd</b> <glossary tag="operation">operation</glossary>, LiveCode first converts both <glossary tag="operand">operands</glossary> to their <glossary tag="binary">binary</glossary> equivalent, a string of ones and zeroes. 1 is equivalent to true, and 0 is equivalent to false.</p><p/><p>For each bit of <i>number1</i>, LiveCode performs an <operator tag="and">and</operator> <glossary tag="operation">operation</glossary> with the corresponding <glossary tag="bit">bit</glossary> of <i>number2</i> to produce a result. A <glossary tag="bit">bit</glossary> is 1 if the corresponding <glossary tag="bit">bits</glossary> of <i>number1</i> and <i>number2</i> are both 1. Otherwise, the <glossary tag="bit">bit</glossary> is 0.</p><p/><p>Finally, the binary number thus created is converted back to decimal.</p>
  </description>
</doc>