|
@@ 64-73 (lines=10) @@
|
| 61 |
|
* @param int $scale
|
| 62 |
|
* @return string
|
| 63 |
|
*/
|
| 64 |
|
public static function mul($leftOperand, $rightOperand, $scale = null)
|
| 65 |
|
{
|
| 66 |
|
$leftOperand = self::convertScientificNotationToString($leftOperand);
|
| 67 |
|
$rightOperand = self::convertScientificNotationToString($rightOperand);
|
| 68 |
|
|
| 69 |
|
if (null === $scale) {
|
| 70 |
|
return bcmul($leftOperand, $rightOperand);
|
| 71 |
|
}
|
| 72 |
|
return bcmul($leftOperand, $rightOperand, $scale);
|
| 73 |
|
}
|
| 74 |
|
|
| 75 |
|
/**
|
| 76 |
|
* @param string $leftOperand
|
|
@@ 92-101 (lines=10) @@
|
| 89 |
|
* @param int $scale
|
| 90 |
|
* @return string
|
| 91 |
|
*/
|
| 92 |
|
public static function div($leftOperand, $rightOperand, $scale = null)
|
| 93 |
|
{
|
| 94 |
|
$leftOperand = self::convertScientificNotationToString($leftOperand);
|
| 95 |
|
$rightOperand = self::convertScientificNotationToString($rightOperand);
|
| 96 |
|
|
| 97 |
|
if (null === $scale) {
|
| 98 |
|
return bcdiv($leftOperand, $rightOperand);
|
| 99 |
|
}
|
| 100 |
|
return bcdiv($leftOperand, $rightOperand, $scale);
|
| 101 |
|
}
|
| 102 |
|
|
| 103 |
|
/**
|
| 104 |
|
* @param int|string $number
|