mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
WS, prepare for new style
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@228179 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
c0c79b8db8
commit
918764d05f
10 changed files with 365 additions and 377 deletions
|
@ -1,32 +1,32 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/bc.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.bcadd">
|
||||
<refnamediv>
|
||||
<refname>bcadd</refname>
|
||||
<refpurpose>Add two arbitrary precision numbers</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcadd</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Adds the <parameter>left_operand</parameter> to the
|
||||
<parameter>right_operand</parameter> and returns the sum in a
|
||||
string. The optional <parameter>scale</parameter> parameter is
|
||||
used to set the number of digits after the decimal place in the
|
||||
result.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcadd</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.bcadd">
|
||||
<refnamediv>
|
||||
<refname>bcadd</refname>
|
||||
<refpurpose>Add two arbitrary precision numbers</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcadd</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Adds the <parameter>left_operand</parameter> to the
|
||||
<parameter>right_operand</parameter> and returns the sum in a
|
||||
string. The optional <parameter>scale</parameter> parameter is
|
||||
used to set the number of digits after the decimal place in the
|
||||
result.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcadd</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
|
@ -38,16 +38,16 @@ echo bcadd($a, $b, 4); // 6.2340
|
|||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcsub</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcsub</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/bc.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.bccomp">
|
||||
<refnamediv>
|
||||
<refname>bccomp</refname>
|
||||
<refpurpose>Compare two arbitrary precision numbers</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>bccomp</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Compares the <parameter>left_operand</parameter> to the
|
||||
<parameter>right_operand</parameter> and returns the result as an
|
||||
integer. The optional <parameter>scale</parameter> parameter is
|
||||
used to set the number of digits after the decimal place which
|
||||
will be used in the comparison. The return value is 0 if the two
|
||||
operands are equal. If the <parameter>left_operand</parameter>
|
||||
is larger than the <parameter>right_operand</parameter> the
|
||||
return value is +1 and if the <parameter>left_operand</parameter>
|
||||
is less than the <parameter>right_operand</parameter> the return
|
||||
value is -1.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bccomp</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.bccomp">
|
||||
<refnamediv>
|
||||
<refname>bccomp</refname>
|
||||
<refpurpose>Compare two arbitrary precision numbers</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>bccomp</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Compares the <parameter>left_operand</parameter> to the
|
||||
<parameter>right_operand</parameter> and returns the result as an
|
||||
integer. The optional <parameter>scale</parameter> parameter is
|
||||
used to set the number of digits after the decimal place which
|
||||
will be used in the comparison. The return value is 0 if the two
|
||||
operands are equal. If the <parameter>left_operand</parameter>
|
||||
is larger than the <parameter>right_operand</parameter> the
|
||||
return value is +1 and if the <parameter>left_operand</parameter>
|
||||
is less than the <parameter>right_operand</parameter> the return
|
||||
value is -1.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bccomp</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
|
@ -41,10 +41,10 @@ echo bccomp('1.00001', '1', 5); // 1
|
|||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/bc.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.bcdiv">
|
||||
<refnamediv>
|
||||
<refname>bcdiv</refname>
|
||||
<refpurpose>Divide two arbitrary precision numbers</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcdiv</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Divides the <parameter>left_operand</parameter> by the
|
||||
<parameter>right_operand</parameter> and returns the result. The
|
||||
optional <parameter>scale</parameter> sets the number of digits
|
||||
after the decimal place in the result, which defaults to 0.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcdiv</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.bcdiv">
|
||||
<refnamediv>
|
||||
<refname>bcdiv</refname>
|
||||
<refpurpose>Divide two arbitrary precision numbers</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcdiv</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Divides the <parameter>left_operand</parameter> by the
|
||||
<parameter>right_operand</parameter> and returns the result. The
|
||||
optional <parameter>scale</parameter> sets the number of digits
|
||||
after the decimal place in the result, which defaults to 0.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcdiv</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
|
@ -33,16 +33,16 @@ echo bcdiv('105', '6.55957', 3); // 16.007
|
|||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcmul</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcmul</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,46 +1,44 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/bc.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.bcmod">
|
||||
<refnamediv>
|
||||
<refname>bcmod</refname>
|
||||
<refpurpose>
|
||||
Get modulus of an arbitrary precision number
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcmod</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>modulus</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Get the modulus of the <parameter>left_operand</parameter> using
|
||||
<parameter>modulus</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcmod</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.bcmod">
|
||||
<refnamediv>
|
||||
<refname>bcmod</refname>
|
||||
<refpurpose>Get modulus of an arbitrary precision number</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcmod</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>modulus</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Get the modulus of the <parameter>left_operand</parameter> using
|
||||
<parameter>modulus</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&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>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcdiv</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcdiv</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/bc.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.bcmul">
|
||||
<refnamediv>
|
||||
<refname>bcmul</refname>
|
||||
<refpurpose>Multiply two arbitrary precision number</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcmul</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Multiply the <parameter>left_operand</parameter> by the
|
||||
<parameter>right_operand</parameter> and returns the result. The
|
||||
optional <parameter>scale</parameter> sets the number of digits
|
||||
after the decimal place in the result (by truncating).
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcmul</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.bcmul">
|
||||
<refnamediv>
|
||||
<refname>bcmul</refname>
|
||||
<refpurpose>Multiply two arbitrary precision number</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcmul</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Multiply the <parameter>left_operand</parameter> by the
|
||||
<parameter>right_operand</parameter> and returns the result. The
|
||||
optional <parameter>scale</parameter> sets the number of digits
|
||||
after the decimal place in the result (by truncating).
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcmul</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
echo bcmul('1.34747474747', '35', 3); // 47.161
|
||||
echo bcmul('2', '4'); // 8
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcdiv</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcdiv</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,33 +1,31 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- splitted from ./en/functions/bc.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.bcpow">
|
||||
<refnamediv>
|
||||
<refname>bcpow</refname>
|
||||
<refpurpose>
|
||||
Raise an arbitrary precision number to another
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcpow</methodname>
|
||||
<methodparam><type>string</type><parameter>x</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>y</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Raise <parameter>x</parameter> to the power
|
||||
<parameter>y</parameter>. The optional
|
||||
<parameter>scale</parameter> can be used to set the number of
|
||||
digits after the decimal place in the result.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcpow</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.bcpow">
|
||||
<refnamediv>
|
||||
<refname>bcpow</refname>
|
||||
<refpurpose>Raise an arbitrary precision number to another</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcpow</methodname>
|
||||
<methodparam><type>string</type><parameter>x</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>y</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Raise <parameter>x</parameter> to the power
|
||||
<parameter>y</parameter>. The optional
|
||||
<parameter>scale</parameter> can be used to set the number of
|
||||
digits after the decimal place in the result.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcpow</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
|
@ -35,17 +33,17 @@ echo bcpow('4.2', '3', 2); // 74.08
|
|||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcpowmod</function>&listendand;
|
||||
<function>bcsqrt</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcpowmod</function>&listendand;
|
||||
<function>bcsqrt</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,66 +1,64 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry id="function.bcpowmod">
|
||||
<refnamediv>
|
||||
<refname>bcpowmod</refname>
|
||||
<refpurpose>
|
||||
Raise an arbitrary precision number to another, reduced by a specified modulus
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcpowmod</methodname>
|
||||
<methodparam><type>string</type><parameter>x</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>y</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>modulus</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use the fast-exponentiation method to raise <parameter>x</parameter>
|
||||
to the power <parameter>y</parameter> with respect to the modulus
|
||||
<parameter>modulus</parameter>. The optional
|
||||
<parameter>scale</parameter> can be used to set the number of
|
||||
digits after the decimal place in the result.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Because this method uses the modulus operation, non-natural numbers
|
||||
may give unexpected results. A natural number is any positive
|
||||
non-zero integer.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
The following two statements are functionally identical. The
|
||||
<function>bcpowmod</function> version however, executes in
|
||||
less time and can accept larger parameters.
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.bcpowmod">
|
||||
<refnamediv>
|
||||
<refname>bcpowmod</refname>
|
||||
<refpurpose>Raise an arbitrary precision number to another, reduced by a specified modulus</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcpowmod</methodname>
|
||||
<methodparam><type>string</type><parameter>x</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>y</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>modulus</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use the fast-exponentiation method to raise <parameter>x</parameter>
|
||||
to the power <parameter>y</parameter> with respect to the modulus
|
||||
<parameter>modulus</parameter>. The optional
|
||||
<parameter>scale</parameter> can be used to set the number of
|
||||
digits after the decimal place in the result.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Because this method uses the modulus operation, non-natural numbers
|
||||
may give unexpected results. A natural number is any positive
|
||||
non-zero integer.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
The following two statements are functionally identical. The
|
||||
<function>bcpowmod</function> version however, executes in
|
||||
less time and can accept larger parameters.
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$a = bcpowmod($x, $y, $mod);
|
||||
|
||||
$b = bcmod(bcpow($x, $y), $mod);
|
||||
|
||||
// $a and $b are equal to each other.
|
||||
// $a and $b are equal to each other.
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcpow</function>&listendand;
|
||||
<function>bcmod</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcpow</function>&listendand;
|
||||
<function>bcmod</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,30 +1,28 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/bc.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.bcscale">
|
||||
<refnamediv>
|
||||
<refname>bcscale</refname>
|
||||
<refpurpose>
|
||||
Set default scale parameter for all bc math functions
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>bcscale</methodname>
|
||||
<methodparam><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function sets the default scale parameter for all subsequent
|
||||
bc math functions that do not explicitly specify a scale
|
||||
parameter. &return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcscale</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.bcscale">
|
||||
<refnamediv>
|
||||
<refname>bcscale</refname>
|
||||
<refpurpose>Set default scale parameter for all bc math functions</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>bcscale</methodname>
|
||||
<methodparam><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function sets the default scale parameter for all subsequent
|
||||
bc math functions that do not explicitly specify a scale
|
||||
parameter. &return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcscale</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
|
@ -37,10 +35,10 @@ echo bcdiv('105', '6.55957', 3); // 16.007
|
|||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,31 +1,29 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/bc.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.bcsqrt">
|
||||
<refnamediv>
|
||||
<refname>bcsqrt</refname>
|
||||
<refpurpose>
|
||||
Get the square root of an arbitrary precision number
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcsqrt</methodname>
|
||||
<methodparam><type>string</type><parameter>operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Return the square root of the <parameter>operand</parameter>.
|
||||
The optional <parameter>scale</parameter> parameter sets the
|
||||
number of digits after the decimal place in the result.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcsqrt</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.bcsqrt">
|
||||
<refnamediv>
|
||||
<refname>bcsqrt</refname>
|
||||
<refpurpose>Get the square root of an arbitrary precision number</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcsqrt</methodname>
|
||||
<methodparam><type>string</type><parameter>operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Return the square root of the <parameter>operand</parameter>.
|
||||
The optional <parameter>scale</parameter> parameter sets the
|
||||
number of digits after the decimal place in the result.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcsqrt</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
|
@ -33,16 +31,16 @@ echo bcsqrt('2', 3); // 1.414
|
|||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcpow</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcpow</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -1,55 +1,53 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/bc.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.bcsub">
|
||||
<refnamediv>
|
||||
<refname>bcsub</refname>
|
||||
<refpurpose>
|
||||
Subtract one arbitrary precision number from another
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcsub</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Subtracts the <parameter>right_operand</parameter> from the
|
||||
<parameter>left_operand</parameter> and returns the result in a
|
||||
string. The optional <parameter>scale</parameter> parameter is
|
||||
used to set the number of digits after the decimal place in the
|
||||
result.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcsub</function> example</title>
|
||||
<programlisting role="php">
|
||||
<refentry id="function.bcsub">
|
||||
<refnamediv>
|
||||
<refname>bcsub</refname>
|
||||
<refpurpose>Subtract one arbitrary precision number from another</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>bcsub</methodname>
|
||||
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>scale</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Subtracts the <parameter>right_operand</parameter> from the
|
||||
<parameter>left_operand</parameter> and returns the result in a
|
||||
string. The optional <parameter>scale</parameter> parameter is
|
||||
used to set the number of digits after the decimal place in the
|
||||
result.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>bcsub</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$a = '1.234';
|
||||
$b = '5';
|
||||
|
||||
|
||||
echo bcsub($a, $b); // -3
|
||||
echo bcsub($a, $b, 4); // -3.7660
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcadd</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<function>bcadd</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
Loading…
Reference in a new issue