mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 17:08:54 +00:00

removing the others git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78562 c90b9560-bf6c-de11-be94-00142212c4b1
311 lines
10 KiB
XML
311 lines
10 KiB
XML
<!-- D O N O T E D I T T H I S F I L E ! ! !
|
|
|
|
it is still here for historical reasons only
|
|
(as translators may need to check old revision diffs)
|
|
|
|
if you want to change things documented in this file
|
|
you should now edit the files found under en/reference
|
|
instead -->
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.25 $ -->
|
|
<reference id="ref.bc">
|
|
<title>BCMath Arbitrary Precision Mathematics Functions</title>
|
|
<titleabbrev>BC math</titleabbrev>
|
|
|
|
<partintro>
|
|
<para id="bc.intro">
|
|
For arbitrary precision mathematics PHP offers the Binary Calculator which
|
|
supports numbers of any size and precision, represented as strings.
|
|
</para>
|
|
|
|
<section id="bc.requirements">
|
|
<title>Requirements</title>
|
|
<para>
|
|
Due to changes in the licensing, the BCMATH library is distributed
|
|
separate from the standard PHP source distribution.
|
|
You can download the tar-gzipped archive at the url:
|
|
<ulink url="&url.bcmath;">&url.bcmath;</ulink>. Read the
|
|
file <filename>README.BCMATH</filename> in the PHP distribution
|
|
for more information.
|
|
</para>
|
|
</section>
|
|
|
|
<section id="bc.installation">
|
|
<title>Installation</title>
|
|
<para>
|
|
In PHP 4, these functions are only available if PHP was configured with
|
|
<link linkend="install.configure.enable-bcmath"><option role="configure">--enable-bcmath</option></link>.
|
|
In PHP 3, these functions are only available if PHP was not configured with
|
|
<link linkend="install.configure.disable-bcmath"><option role="configure">--disable-bcmath</option></link>.
|
|
</para>
|
|
</section>
|
|
|
|
<section id="bc.configuration">
|
|
<title>Runtime Configuration</title>
|
|
&no.config;
|
|
</section>
|
|
|
|
<section id="bc.resources">
|
|
<title>Resource types</title>
|
|
&no.resource;
|
|
</section>
|
|
|
|
<section id="bc.constants">
|
|
<title>Predefined constants</title>
|
|
&no.constants;
|
|
</section>
|
|
</partintro>
|
|
|
|
<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>
|
|
<para>
|
|
See also <function>bcsub</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<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>
|
|
</refentry>
|
|
|
|
<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.
|
|
</para>
|
|
<para>
|
|
See also <function>bcmul</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<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>
|
|
<para>
|
|
See also <function>bcdiv</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<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.
|
|
</para>
|
|
<para>
|
|
See also <function>bcdiv</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<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>
|
|
<para>
|
|
See also <function>bcsqrt</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<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>string</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.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<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>
|
|
<para>
|
|
See also <function>bcpow</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<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>
|
|
<para>
|
|
See also <function>bcadd</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
</reference>
|
|
|
|
<!-- 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
|
|
-->
|
|
|