1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-26 00:32:15 +01:00
Files
archived-doc-ru/reference/bc/functions/bcmod.xml
Sergey Panteleev 6d43fd64d7 Исправление форматирования
[skip-spellcheck]
[skip-lint]
2022-12-27 03:42:36 +03:00

154 lines
4.2 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 4754397753fd79f1c846868b66a2448babab1c54 Maintainer: tmn Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.bcmod" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>bcmod</refname>
<refpurpose>
Получает остаток от деления чисел с произвольной точностью
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>bcmod</methodname>
<methodparam><type>string</type><parameter>num1</parameter></methodparam>
<methodparam><type>string</type><parameter>num2</parameter></methodparam>
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>scale</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
Получает остаток от деления <parameter>num1</parameter> на
<parameter>num2</parameter>.
Если <parameter>num2</parameter> не равен нулю, результат будет иметь такой
же знак, что и <parameter>num1</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>num1</parameter></term>
<listitem>
<para>
Делимое в виде строки.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>num2</parameter></term>
<listitem>
<para>
Правый операнд (модуль) в виде строки.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает остаток от деления в виде строки или &null;, если
<parameter>num2</parameter> равен <literal>0</literal>.
</para>
</refsect1>
<refsect1 role="changelog"><!-- {{{ -->
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
<parameter>scale</parameter> теперь допускает значение null.
</entry>
</row>
<row>
<entry>7.2.0</entry>
<entry>
<parameter>num1</parameter> и <parameter>num2</parameter> больше не
обрезаются до целого, так что теперь поведение <function>bcmod</function>
соответствует <function>fmod</function>, а не оператору <literal>%</literal>.
</entry>
</row>
<row>
<entry>7.2.0</entry>
<entry>
Добавлен параметр <parameter>scale</parameter>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1><!-- }}} -->
<refsect1 role="examples">
&reftitle.examples;
<example>
<title>Пример использования <function>bcmod</function></title>
<programlisting role="php">
<![CDATA[
<?php
bcscale(0);
echo bcmod( '5', '3'); // 2
echo bcmod( '5', '-3'); // 2
echo bcmod('-5', '3'); // -2
echo bcmod('-5', '-3'); // -2
?>
]]>
</programlisting>
</example>
<example>
<title>Пример использования <function>bcmod</function> с десятичными знаками</title>
<programlisting role="php">
<![CDATA[
<?php
bcscale(1);
echo bcmod('5.7', '1.3'); // 0.5 с PHP 7.2.0; 0 ранее
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>bcdiv</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
-->