|
@@ 165-175 (lines=11) @@
|
| 162 |
|
* @param null|int $scale
|
| 163 |
|
* @return string
|
| 164 |
|
*/
|
| 165 |
|
public static function mul($leftOperand, $rightOperand, $scale = null)
|
| 166 |
|
{
|
| 167 |
|
$leftOperand = self::convertScientificNotationToString($leftOperand);
|
| 168 |
|
$rightOperand = self::convertScientificNotationToString($rightOperand);
|
| 169 |
|
|
| 170 |
|
if (null === $scale) {
|
| 171 |
|
return bcmul($leftOperand, $rightOperand);
|
| 172 |
|
}
|
| 173 |
|
|
| 174 |
|
return bcmul($leftOperand, $rightOperand, $scale);
|
| 175 |
|
}
|
| 176 |
|
|
| 177 |
|
/**
|
| 178 |
|
* @param string $arg
|
|
@@ 198-208 (lines=11) @@
|
| 195 |
|
* @param null|int $scale
|
| 196 |
|
* @return string
|
| 197 |
|
*/
|
| 198 |
|
public static function add($leftOperand, $rightOperand, $scale = null)
|
| 199 |
|
{
|
| 200 |
|
$leftOperand = self::convertScientificNotationToString($leftOperand);
|
| 201 |
|
$rightOperand = self::convertScientificNotationToString($rightOperand);
|
| 202 |
|
|
| 203 |
|
if (null === $scale) {
|
| 204 |
|
return bcadd($leftOperand, $rightOperand);
|
| 205 |
|
}
|
| 206 |
|
|
| 207 |
|
return bcadd($leftOperand, $rightOperand, $scale);
|
| 208 |
|
}
|
| 209 |
|
|
| 210 |
|
/**
|
| 211 |
|
* @param string $leftOperand
|
|
@@ 216-226 (lines=11) @@
|
| 213 |
|
* @param null|int $scale
|
| 214 |
|
* @return string
|
| 215 |
|
*/
|
| 216 |
|
public static function div($leftOperand, $rightOperand, $scale = null)
|
| 217 |
|
{
|
| 218 |
|
$leftOperand = self::convertScientificNotationToString($leftOperand);
|
| 219 |
|
$rightOperand = self::convertScientificNotationToString($rightOperand);
|
| 220 |
|
|
| 221 |
|
if (null === $scale) {
|
| 222 |
|
return bcdiv($leftOperand, $rightOperand);
|
| 223 |
|
}
|
| 224 |
|
|
| 225 |
|
return bcdiv($leftOperand, $rightOperand, $scale);
|
| 226 |
|
}
|
| 227 |
|
|
| 228 |
|
/**
|
| 229 |
|
* @param string $arg
|
|
@@ 289-299 (lines=11) @@
|
| 286 |
|
* @param null|int $scale
|
| 287 |
|
* @return string
|
| 288 |
|
*/
|
| 289 |
|
public static function sub($leftOperand, $rightOperand, $scale = null)
|
| 290 |
|
{
|
| 291 |
|
$leftOperand = self::convertScientificNotationToString($leftOperand);
|
| 292 |
|
$rightOperand = self::convertScientificNotationToString($rightOperand);
|
| 293 |
|
|
| 294 |
|
if (null === $scale) {
|
| 295 |
|
return bcsub($leftOperand, $rightOperand);
|
| 296 |
|
}
|
| 297 |
|
|
| 298 |
|
return bcsub($leftOperand, $rightOperand, $scale);
|
| 299 |
|
}
|
| 300 |
|
|
| 301 |
|
/**
|
| 302 |
|
* @param $number
|