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

Breadcrumb

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

function BigDecimal::one

Returns a BigDecimal representing one, with a scale of zero.

@psalm-pure

2 calls to BigDecimal::one()
BigDecimal::power in vendor/brick/math/src/BigDecimal.php
Returns this number exponentiated to the given value.
BigDecimal::toScale in vendor/brick/math/src/BigDecimal.php
Converts this number to a BigDecimal with the given scale, using rounding if necessary.

File

vendor/brick/math/src/BigDecimal.php, line 101

Class

BigDecimal
Immutable, arbitrary-precision signed decimal numbers.

Namespace

Brick\Math

Code

public static function one() : BigDecimal {
    
    /**
     * @psalm-suppress ImpureStaticVariable
     * @var BigDecimal|null $one
     */
    static $one;
    if ($one === null) {
        $one = new BigDecimal('1');
    }
    return $one;
}

API Navigation

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