<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="divz">
  <refmeta>
    <refentrytitle>divz</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>divz</refname>

    <refpurpose>
       Safely divides two numbers.
       <indexterm id="IndexDivz"><primary>divz</primary></indexterm>
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>divz</command> xa, xb, ksubst</synopsis>
    <synopsis>ir <command>divz</command> ia, ib, isubst</synopsis>
    <synopsis>kr <command>divz</command> ka, kb, ksubst</synopsis>
  </refsect1>

  <refsect1>
    <title>Description</title>
    <para> 
      Safely divides two numbers.
    </para> 
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      Whenever <emphasis>b</emphasis> is not zero, set the result to the value <emphasis>a / b</emphasis>; when <emphasis>b</emphasis> is zero, set it to the value of <emphasis>subst</emphasis> instead.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the divz opcode. It uses the files <ulink url="examples/divz.orc"><citetitle>divz.orc</citetitle></ulink> and <ulink url="examples/divz.sco"><citetitle>divz.sco</citetitle></ulink>.

      <example>
        <title>Example of the divz opcode.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/divz.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/divz.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>

      Its output should include lines like:
      <screen>
200.000000 / 0.000000 = -1.000000
200.000000 / 19.999887 = 10.000056
200.000000 / 40.000027 = 4.999997
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="assign"><citetitle>=</citetitle></link>,
      <link linkend="init"><citetitle>init</citetitle></link>,
      <link linkend="tival"><citetitle>tival</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
