function BigInteger::plus
Returns the sum of this number and the given one.
Parameters
BigNumber|int|float|string $that The number to add. Must be convertible to a BigInteger.:
Throws
MathException If the number is not valid, or is not convertible to a BigInteger.
File
-
vendor/
brick/ math/ src/ BigInteger.php, line 364
Class
- BigInteger
- An arbitrary-size integer.
Namespace
Brick\MathCode
public function plus(BigNumber|int|float|string $that) : BigInteger {
$that = BigInteger::of($that);
if ($that->value === '0') {
return $this;
}
if ($this->value === '0') {
return $that;
}
$value = Calculator::get()->add($this->value, $that->value);
return new BigInteger($value);
}