You are here: Home // BCMath Arbitrary Precision Mathematics Functions
bcsub
(PHP3 , PHP4 )
bcsub – Subtract one arbitrary precision number from another
Description
string bcsub (string left operand, string right operand [, int scale])
Subtracts the right operand from the left operand and returns the result in a string. The optional scale parameter is used to set the number of digits after the decimal place in the result.
See
bcsqrt
(PHP3 , PHP4 )
bcsqrt – Get the square root of an arbitray precision number
Description
string bcsqrt (string operand, int scale)
Return the square root of the operand. The optional scale parameter sets the number of digits after the decimal place in the result.
See also bcpow().
bcscale
(PHP3 , PHP4 )
bcscale – Set default scale parameter for all bc math functions
Description
string bcscale (int scale)
This function sets the default scale parameter for all subsequent bc math functions that do not explicitly specify a scale parameter.
bcpow
(PHP3 , PHP4 )
bcpow – Raise an arbitrary precision number to another
Description
string bcpow (string x, string y [, int scale])
Raise x to the power y. The optional scale can be used to set the number of digits after the decimal place in the result.
See also bcsqrt().
bcmul
(PHP3 , PHP4 )
bcmul – Multiply two arbitrary precision number
Description
string bcmul (string left operand, string right operand [, int scale])
Multiply the left operand by the right operand and returns the result. The optional scale sets the number of digits after the decimal place in the result.
See also bcdiv().
bcmod
(PHP3 , PHP4 )
bcmod – Get modulus of an arbitrary precision number
Description
string bcmod (string left operand, string modulus)
Get the modulus of the left operand using modulus.
See also bcdiv().
bcdiv
(PHP3 , PHP4 )
bcdiv – Divide two arbitrary precision numbers
Description
string bcdiv (string left operand, string right operand [, int scale])
Divides the left operand by the right operand and returns the result. The optional scale sets the number of digits after the decimal place in the result.
See also bcmul().
bccomp
(PHP3 , PHP4 )
bccomp – Compare two arbitrary precision numbers
Description
int bccomp (string left operand, string right operand [, int scale])
Compares the left operand to the right operand and returns the result as an integer. The optional scale parameter is used to set the number of digits after the decimal place which will be used in the comparion. The
bcadd
(PHP3 , PHP4 )
bcadd – Add two arbitrary precision numbers
Description
string bcadd (string left operand, string right operand [, int scale])
Adds the left operand to the right operand and returns the sum in a string. The optional scale parameter is used to set the number of digits after the decimal place in the result.
See also bcsub().















































