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

Breadcrumb

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

function BigInteger::minus

Returns the difference of this number and the given one.

Parameters

BigNumber|int|float|string $that The number to subtract. 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 388

Class

BigInteger
An arbitrary-size integer.

Namespace

Brick\Math

Code

public function minus(BigNumber|int|float|string $that) : BigInteger {
    $that = BigInteger::of($that);
    if ($that->value === '0') {
        return $this;
    }
    $value = Calculator::get()->sub($this->value, $that->value);
    return new BigInteger($value);
}

API Navigation

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