php-doc-en/reference/bc/functions/bcmod.xml
Jakub Vrana ad36239c14 Unify language
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344123 c90b9560-bf6c-de11-be94-00142212c4b1
2018-01-31 07:37:42 +00:00

130 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.bcmod" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>bcmod</refname>
<refpurpose>Get modulus of an arbitrary precision number</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>bcmod</methodname>
<methodparam><type>string</type><parameter>dividend</parameter></methodparam>
<methodparam><type>string</type><parameter>modulus</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
</methodsynopsis>
<para>
Get the modulus of the <parameter>dividend</parameter> using
<parameter>modulus</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>dividend</parameter></term>
<listitem>
<para>
The dividend, as a string.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>modulus</parameter></term>
<listitem>
<para>
The modulus, as a string.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the modulus as a string, or &null; if
<parameter>modulus</parameter> is <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>7.2.0</entry>
<entry>
<parameter>dividend</parameter> and <parameter>modulus</parameter> are no
longer truncated to integer, so now the behavior of
<function>bcmod</function> follows <function>fmod</function> rather than
the <literal>%</literal> operator.
</entry>
</row>
<row>
<entry>7.2.0</entry>
<entry>
The <parameter>scale</parameter> parameter was added.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1><!-- }}} -->
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>bcmod</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
echo bcmod('4', '2'); // 0
echo bcmod('2', '4'); // 2
?>
]]>
</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
-->