|
@@ 190-200 (lines=11) @@
|
| 187 |
|
* @param null|int $scale |
| 188 |
|
* @return string |
| 189 |
|
*/ |
| 190 |
|
public static function mul($leftOperand, $rightOperand, $scale = null) |
| 191 |
|
{ |
| 192 |
|
$leftOperand = self::convertScientificNotationToString($leftOperand); |
| 193 |
|
$rightOperand = self::convertScientificNotationToString($rightOperand); |
| 194 |
|
|
| 195 |
|
if (null === $scale) { |
| 196 |
|
return bcmul($leftOperand, $rightOperand); |
| 197 |
|
} |
| 198 |
|
|
| 199 |
|
return bcmul($leftOperand, $rightOperand, $scale); |
| 200 |
|
} |
| 201 |
|
|
| 202 |
|
/** |
| 203 |
|
* @param string $arg |
|
@@ 223-233 (lines=11) @@
|
| 220 |
|
* @param null|int $scale |
| 221 |
|
* @return string |
| 222 |
|
*/ |
| 223 |
|
public static function add($leftOperand, $rightOperand, $scale = null) |
| 224 |
|
{ |
| 225 |
|
$leftOperand = self::convertScientificNotationToString($leftOperand); |
| 226 |
|
$rightOperand = self::convertScientificNotationToString($rightOperand); |
| 227 |
|
|
| 228 |
|
if (null === $scale) { |
| 229 |
|
return bcadd($leftOperand, $rightOperand); |
| 230 |
|
} |
| 231 |
|
|
| 232 |
|
return bcadd($leftOperand, $rightOperand, $scale); |
| 233 |
|
} |
| 234 |
|
|
| 235 |
|
/** |
| 236 |
|
* @param string $leftOperand |
|
@@ 241-251 (lines=11) @@
|
| 238 |
|
* @param null|int $scale |
| 239 |
|
* @return string |
| 240 |
|
*/ |
| 241 |
|
public static function div($leftOperand, $rightOperand, $scale = null) |
| 242 |
|
{ |
| 243 |
|
$leftOperand = self::convertScientificNotationToString($leftOperand); |
| 244 |
|
$rightOperand = self::convertScientificNotationToString($rightOperand); |
| 245 |
|
|
| 246 |
|
if (null === $scale) { |
| 247 |
|
return bcdiv($leftOperand, $rightOperand); |
| 248 |
|
} |
| 249 |
|
|
| 250 |
|
return bcdiv($leftOperand, $rightOperand, $scale); |
| 251 |
|
} |
| 252 |
|
|
| 253 |
|
/** |
| 254 |
|
* @param string $arg |
|
@@ 314-324 (lines=11) @@
|
| 311 |
|
* @param null|int $scale |
| 312 |
|
* @return string |
| 313 |
|
*/ |
| 314 |
|
public static function sub($leftOperand, $rightOperand, $scale = null) |
| 315 |
|
{ |
| 316 |
|
$leftOperand = self::convertScientificNotationToString($leftOperand); |
| 317 |
|
$rightOperand = self::convertScientificNotationToString($rightOperand); |
| 318 |
|
|
| 319 |
|
if (null === $scale) { |
| 320 |
|
return bcsub($leftOperand, $rightOperand); |
| 321 |
|
} |
| 322 |
|
|
| 323 |
|
return bcsub($leftOperand, $rightOperand, $scale); |
| 324 |
|
} |
| 325 |
|
|
| 326 |
|
/** |
| 327 |
|
* @param $number |