I l@ve RuBoard Previous Section Next Section

bcmul

string bcmul(string left_operand, string right_operand, [int scale]) 

left_operand

Number to be multiplied

right_operand

Number to multiply by

scale

Number of decimal places to return

Multiplies two numbers.

Returns:

Product of two numbers

Description:

Multiplies the value of the first number by the value of the second number and returns the result, formatted with a specified number of decimal places (optional). The following example shows BC's ability to handle huge numbers.

Version:

Existing since version 3.0

Example:

Multiply two large numbers
$num1 = "9912343.34546"; 
$num2 = "34546.9912343"; 
echo bcmul($num1,$num2,3); 

Output: 
342441636328.624 
    I l@ve RuBoard Previous Section Next Section