<HTML ><HEAD ><TITLE >BCMath Arbitrary Precision Mathematics Functions</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="Function Reference" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="aspell_suggest" HREF="function.aspell-suggest.html"><LINK REL="NEXT" TITLE="bcadd" HREF="function.bcadd.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="reference" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.aspell-suggest.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.bcadd.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.bc" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >IV. BCMath Arbitrary Precision Mathematics Functions</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN9507" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="bc.intro" ></A >Introduction</H1 ><P > For arbitrary precision mathematics PHP offers the Binary Calculator which supports numbers of any size and precision, represented as strings. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="bc.requirements" ></A >Requirements</H1 ><P > Since PHP 4.0.4, libbcmath is bundled with PHP. You don't need any external libraries for this extension. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="bc.installation" ></A >Installation</H1 ><P > In PHP 4, these functions are only available if <TT CLASS="literal" >PHP</TT > was configured with <TT CLASS="option" >--enable-bcmath</TT >. In PHP 3, these functions are only available if <TT CLASS="literal" >PHP</TT > was NOT configured with <TT CLASS="option" >--disable-bcmath</TT >. </P ><P > The windows version of <TT CLASS="literal" >PHP</TT > has built in support for this extension. You do not need to load any additional extension in order to use these functions.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="bc.configuration" ></A >Runtime Configuration</H1 ><P > The behaviour of these functions is affected by settings in <TT CLASS="filename" >php.ini</TT >. </P ><P > <DIV CLASS="table" ><A NAME="AEN9528" ></A ><P ><B >Table 1. BC math configuration options</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><THEAD ><TR ><TH ALIGN="LEFT" VALIGN="MIDDLE" >Name</TH ><TH ALIGN="LEFT" VALIGN="MIDDLE" >Default</TH ><TH ALIGN="LEFT" VALIGN="MIDDLE" >Changeable</TH ></TR ></THEAD ><TBODY ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >bcmath.scale</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >0</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >PHP_INI_ALL</TD ></TR ></TBODY ></TABLE ></DIV > For further details and definition of the PHP_INI_* constants see <A HREF="function.ini-set.html" ><B CLASS="function" >ini_set()</B ></A >. </P ><P > Here is a short explanation of the configuration directives. <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><A NAME="ini.bcmath.scale" ></A ><TT CLASS="parameter" ><I >bcmath.scale</I ></TT > <A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A ></DT ><DD ><P > Number of decimal digits for all bcmath functions. </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="bc.resources" ></A >Resource Types</H1 ><P >This extension has no resource types defined.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="bc.constants" ></A >Predefined Constants</H1 ><P >This extension has no constants defined.</P ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >Table of Contents</B ></DT ><DT ><A HREF="function.bcadd.html" >bcadd</A > -- Add two arbitrary precision numbers</DT ><DT ><A HREF="function.bccomp.html" >bccomp</A > -- Compare two arbitrary precision numbers</DT ><DT ><A HREF="function.bcdiv.html" >bcdiv</A > -- Divide two arbitrary precision numbers</DT ><DT ><A HREF="function.bcmod.html" >bcmod</A > -- Get modulus of an arbitrary precision number </DT ><DT ><A HREF="function.bcmul.html" >bcmul</A > -- Multiply two arbitrary precision number</DT ><DT ><A HREF="function.bcpow.html" >bcpow</A > -- Raise an arbitrary precision number to another </DT ><DT ><A HREF="function.bcpowmod.html" >bcpowmod</A > -- Raise an arbitrary precision number to another, reduced by a specified modulus. </DT ><DT ><A HREF="function.bcscale.html" >bcscale</A > -- Set default scale parameter for all bc math functions </DT ><DT ><A HREF="function.bcsqrt.html" >bcsqrt</A > -- Get the square root of an arbitrary precision number </DT ><DT ><A HREF="function.bcsub.html" >bcsub</A > -- Subtract one arbitrary precision number from another </DT ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.aspell-suggest.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.bcadd.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >aspell_suggest</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >bcadd</TD ></TR ></TABLE ></DIV ></BODY ></HTML >