mirror of
https://github.com/php/doc-ru.git
synced 2025-08-15 23:42:35 +00:00
166 lines
4.5 KiB
XML
166 lines
4.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 039ab719e695141ee54409d26ad828337ec31d6e Maintainer: tmn Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="function.gmp-div-q" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>gmp_div_q</refname>
|
|
<refpurpose>Деление чисел</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>GMP</type><methodname>gmp_div_q</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>
|
|
Делит <parameter>num1</parameter> на <parameter>num2</parameter> и возвращает
|
|
целочисленный результат.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>num1</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Делимое.
|
|
</para>
|
|
&gmp.parameter;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>num2</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Делитель числа <parameter>num1</parameter>.
|
|
</para>
|
|
&gmp.parameter;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>rounding_mode</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Округление результата определяется параметром
|
|
<parameter>rounding_mode</parameter>, который может принимать следующие
|
|
значения:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>GMP_ROUND_ZERO</constant>: Дробная часть просто отрезается.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>GMP_ROUND_PLUSINF</constant>: Результат округляется до
|
|
ближайшего целого в сторону <literal>+бесконечности</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>GMP_ROUND_MINUSINF</constant>: Результат округляется до
|
|
ближайшего целого в сторону <literal>-бесконечности</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
&gmp.parameter;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&gmp.return;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Пример использования <function>gmp_div_q</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$div1 = gmp_div_q("100", "5");
|
|
echo gmp_strval($div1) . "\n";
|
|
|
|
$div2 = gmp_div_q("1", "3");
|
|
echo gmp_strval($div2) . "\n";
|
|
|
|
$div3 = gmp_div_q("1", "3", GMP_ROUND_PLUSINF);
|
|
echo gmp_strval($div3) . "\n";
|
|
|
|
$div4 = gmp_div_q("-1", "4", GMP_ROUND_PLUSINF);
|
|
echo gmp_strval($div4) . "\n";
|
|
|
|
$div5 = gmp_div_q("-1", "4", GMP_ROUND_MINUSINF);
|
|
echo gmp_strval($div5) . "\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
20
|
|
0
|
|
1
|
|
0
|
|
-1
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
Эта функция имеет псевдоним <function>gmp_div</function>.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>gmp_div_r</function></member>
|
|
<member><function>gmp_div_qr</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
|
|
-->
|