Litipk\BigNumbers\DecimalConstants::zero PHP Method

zero() public static method

public static zero ( )
    public static function zero()
    {
        if (self::$ZERO === null) {
            self::$ZERO = Decimal::fromInteger(0);
        }
        return self::$ZERO;
    }

Usage Example

コード例 #1
0
 public function __invoke($value) : ValidationResult
 {
     Assertion::numeric($value);
     $decimalValue = Decimal::fromString((string) $value);
     $floorModulo = $this->floorModulo($decimalValue->sub($this->base), $this->step);
     if ($floorModulo->comp(DecimalConstants::zero()) !== 0) {
         return new ValidationResult(new ValidationError('error.step-number', ['lowValue' => $this->trimZeroDecimal((string) $decimalValue->sub($floorModulo)), 'highValue' => $this->trimZeroDecimal((string) $decimalValue->add($this->step)->sub($floorModulo))]));
     }
     return new ValidationResult();
 }
All Usage Examples Of Litipk\BigNumbers\DecimalConstants::zero