php-doc-en/reference/gmp/functions/gmp-div-qr.xml
2004-02-26 11:14:11 +00:00

69 lines
2.1 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 -->
<refentry id="function.gmp-div-qr">
<refnamediv>
<refname>gmp_div_qr</refname>
<refpurpose>Divide numbers and get quotient and remainder</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>gmp_div_qr</methodname>
<methodparam><type>resource</type><parameter>n</parameter></methodparam>
<methodparam><type>resource</type><parameter>d</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>round</parameter></methodparam>
</methodsynopsis>
<para>
The function divides <parameter>n</parameter> by
<parameter>d</parameter> and returns array, 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>
<para>
See the <function>gmp_div_q</function> function for description
of the <parameter>round</parameter> argument.
</para>
<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>
<para>
See also <function>gmp_div_q</function>,
<function>gmp_div_r</function>.
</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:"../../../../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
-->