function BigInteger::shiftedLeft
Returns the integer left shifted by a given number of bits.
1 call to BigInteger::shiftedLeft()
- BigInteger::shiftedRight in vendor/
brick/ math/ src/ BigInteger.php - Returns the integer right shifted by a given number of bits.
File
-
vendor/
brick/ math/ src/ BigInteger.php, line 750
Class
- BigInteger
- An arbitrary-size integer.
Namespace
Brick\MathCode
public function shiftedLeft(int $distance) : BigInteger {
if ($distance === 0) {
return $this;
}
if ($distance < 0) {
return $this->shiftedRight(-$distance);
}
return $this->multipliedBy(BigInteger::of(2)->power($distance));
}