Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BigInteger.php

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\Math

Code

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));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal