<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.gmp-div-qr" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>gmp_div_qr</refname>
  <refpurpose>Divide numbers and get quotient and remainder</refpurpose>
 </refnamediv>
 
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>array</type><methodname>gmp_div_qr</methodname>
   <methodparam><type class="union"><type>GMP</type><type>int</type><type>string</type></type><parameter>num1</parameter></methodparam>
   <methodparam><type class="union"><type>GMP</type><type>int</type><type>string</type></type><parameter>num2</parameter></methodparam>
   <methodparam choice="opt"><type>int</type><parameter>rounding_mode</parameter><initializer><constant>GMP_ROUND_ZERO</constant></initializer></methodparam>
  </methodsynopsis>
  <para>
   The function divides <parameter>num1</parameter> by <parameter>num2</parameter>.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>num1</parameter></term>
     <listitem>
      <para>
       The number being divided.
      </para>
      &gmp.parameter; 
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>num2</parameter></term>
     <listitem>
      <para>
       The number that <parameter>num1</parameter> is being divided by.
      </para>
      &gmp.parameter; 
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>rounding_mode</parameter></term>
     <listitem>
      <para>
       See the <function>gmp_div_q</function> function for description
       of the <parameter>rounding_mode</parameter> argument.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns an <type>array</type>, with the first
   element being <literal>[n/d]</literal> (the integer result of the
   division) and the second being <literal>(n - [n/d] * d)</literal>
   (the remainder of the division).
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title>Division of GMP numbers</title>
    <programlisting role="php">
<![CDATA[
<?php
$a = gmp_init("0x41682179fbf5");
$res = gmp_div_qr($a, "0xDEFE75");
printf("Result is: q - %s, r - %s",
       gmp_strval($res[0]), gmp_strval($res[1]));
?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>gmp_div_q</function></member>
    <member><function>gmp_div_r</function></member>
   </simplelist>
  </para>
 </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
