<doc>
  <legacy_id>1780</legacy_id>
  <name>div</name>
  <type>operator</type>
  <syntax>
    <example><i>number</i> div<i> divisor</i></example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Math, Logic, &amp; Dates</category>
  </classification>
  <references>
    <operator tag="/">/ Operator</operator>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
    <changed version="1.1"></changed>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Divides one number by another and <glossary tag="return">returns</glossary> the <keyword tag="integer">integer</keyword> part of the result.</summary>
  <examples>
    <example>4 div 2 <code><i>-- evaluates to 2</i></code></example>
    <example>11 div 4 <code><i>-- evaluates to 2 (since 11/4 = 2.75)</i></code></example>
    <example>arrayOfNumbers div 10</example>
  </examples>
  <description>
    <p>Use the <b>div</b> <glossary tag="operator">operator</glossary> to do integer division.</p><p/><p><b>Parameters:</b></p><p>The <i>number</i> is a number, or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a number, or an <glossary tag="array">array</glossary> containing only numbers.</p><p/><p>The <i>divisor</i> is any non-zero number. If the <i>number</i> is an <glossary tag="array">array</glossary>, the <i>divisor</i> is either a non-zero number or an <glossary tag="array">array</glossary> containing only non-zero numbers.</p><p/><p><b>Comments:</b></p><p>If the <i>number</i> to be divided is an <glossary tag="array">array</glossary>, each of the <glossary tag="array">array</glossary> <glossary tag="element">elements</glossary> must be a number. If an <glossary tag="array">array</glossary> is divided by a number, each <keyword tag="element">element</keyword> is divided by the number. If an <glossary tag="array">array</glossary> is divided by an <glossary tag="array">array</glossary>, both <glossary tag="array">arrays</glossary> must have the same number of <glossary tag="element">elements</glossary> and the same dimension, and each <keyword tag="element">element</keyword> in one <glossary tag="array">array</glossary> is divided by the corresponding <keyword tag="element">element</keyword> of the other <glossary tag="array">array</glossary>.</p><p/><p>If an element of an array is empty, the <b>div</b> <glossary tag="operator">operator</glossary> treats its contents as zero.</p><p/><p>The expression<code> dividend div divisor </code>is equivalent to<code> trunc(dividend/divisor)</code>.</p><p/><p>If <i>dividend</i> can be divided evenly into <i>divisor</i>, the <glossary tag="expression">expression</glossary> <code>dividend div divisor</code> is equal to<code> dividend/divisor</code>.</p><p/><p>Attempting to divide by zero causes an execution error.</p><p/><p><code/><b>Note:</b><code/> While using non-integer <i>number</i> and <i>divisor</i> usually produces sensible results, mathematically, integer division is generally defined as a function over the integers, and the results using non-integers may not consistently be what you expect.</p><p/><p><b>Changes:</b></p><p>The option to divide arrays was introduced in version 1.1. In previous versions, only single numbers could be used with the <b>div</b> <glossary tag="operator">operator</glossary>.</p>
  </description>
</doc>
