@param int $number

@return self
430219
public function base10($number)
    {
        if (!is_int($number)) {
            throw new \InvalidArgumentException('Expecting integer');
        }

        if ($this->integerPart === '0' && !$this->fractionalPart) {
            return $this;
        }

        $sign = '';
        $integerPart = $this->integerPart;

        if ($integerPart[0] === '-') {
            $sign = '-';
            $integerPart = substr($integerPart, 1);
        }

        if ($number >= 0) {
            $integerPart = ltrim($integerPart, '0');
            $lengthIntegerPart = strlen($integerPart);
            $integers = $lengthIntegerPart - min($number, $lengthIntegerPart);
            $zeroPad = $number - min($number, $lengthIntegerPart);

            return new self(
                $sign.substr($integerPart, 0, $integers),
                rtrim(str_pad('', $zeroPad, '0').substr($integerPart, $integers).$this->fractionalPart, '0')
            );
        }

        $number = abs($number);
        $lengthFractionalPart = strlen($this->fractionalPart);
        $fractions = $lengthFractionalPart - min($number, $lengthFractionalPart);
        $zeroPad = $number - min($number, $lengthFractionalPart);

        return new self(
            $sign.ltrim($integerPart.substr($this->fractionalPart, 0, $lengthFractionalPart - $fractions).str_pad('', $zeroPad, '0'), '0'),
            substr($this->fractionalPart, $lengthFractionalPart - $fractions)
        );
    }
1231308
private function roundDigit(Number $number)
    {
        if ($number->isCloserToNext()) {
            return $this->add(
                $number->getIntegerPart(),
                $number->getIntegerRoundingMultiplier()
            );
        }

        return $this->add($number->getIntegerPart(), '0');
    }
905110
public function setMinor($number)
    {
        if (!Validator::isNumber($number)) {
            throw new InvalidNumberException($number);
        }

        $this->minor = intval($number);

        return $this;
    }
1009168
public function skip($number)
    {
        $this->iterator = Iterators::skip($this->iterator, $number);
        return $this;
    }
810636
protected function setOption(int $option): self
    {
        $this->setOptions($this->getOptions() | $option);

        return $this;
    }
1116823
public function limit(int $limit): self
    {
        if ($limit < 0) {
            throw new \InvalidArgumentException('Limit must be a non-negative integer');
        }

        $this->filter['limit'] = $limit;

        return $this;
    }
485730
public static function fromString($number)
    {
        $decimalSeparatorPosition = strpos($number, '.');
        if ($decimalSeparatorPosition === false) {
            return new self($number, '');
        }

        return new self(
            substr($number, 0, $decimalSeparatorPosition),
            rtrim(substr($number, $decimalSeparatorPosition + 1), '0')
        );
    }
600979
public function setMajor($number)
    {
        if (!Validator::isNumber($number)) {
            throw new InvalidNumberException($number);
        }

        $this->major = intval($number);

        return $this;
    }
41199
public function subtract($number = null)
    {
        if ($number == null) {
            $this->internalSetOperationModeWithHistory('subtract');
        } elseif($number instanceof Closure) {
            $this->internalSetOperationModeWithHistory('subtract');
            return $this->group($number);
        } else {
            $this->performOperationOnExpressionEngine('subtract', $number);
        }

        return $this;
    }
802050
public function setInt(string $key, int $value): self
    {
        $this->set($key, intval($value));
        return $this;
    }
58066
public function multiply($number = null)
    {
        if ($number === null) {
            $this->internalSetOperationModeWithHistory('multiply');
        } elseif ($number instanceof Closure) {
            $this->internalSetOperationModeWithHistory('multiply');
            return $this->group($number);
        } else {
            $this->performOperationOnExpressionEngine('multiply', $number);
        }

        return $this;
    }
647128
public FunctionCall bindParameter(Number number) {
		int pos = bindings.size();
		String parameterName = function.getNthParameter(pos);
		bindings.put(parameterName, number);
		return this;
	}
797530
public static function times($number, callable $callback = null)
    {
        if ($number < 1) {
            return new static;
        }

        if (is_null($callback)) {
            return new static(range(1, $number));
        }

        return (new static(range(1, $number)))->map($callback);
    }
850100
public function sub(...$numbers)
    {
        foreach ($numbers as $number) {
            $this->number = bcsub($this->number, static::validateInputNumber($number), $this->precision);
        }

        return $this;
    }
35055
public function limit(int $limit): self
    {
        if (-1 > $limit) {
            throw new Exception(sprintf('%s() expects the limit to be greater or equal to -1, %s given', __METHOD__, $limit));
        }

        if ($limit === $this->limit) {
            return $this;
        }

        $clone = clone $this;
        $clone->limit = $limit;

        return $clone;
    }
675514
public function mul(...$numbers)
    {
        foreach ($numbers as $number) {
            $this->number = bcmul($this->number, static::validateInputNumber($number), $this->precision);
        }

        return $this;
    }
995818
public static function fromNumber($number)
    {
        if (is_float($number)) {
            return self::fromString(sprintf('%.14F', $number));
        }

        if (is_int($number)) {
            return new self($number);
        }

        if (is_string($number)) {
            return self::fromString($number);
        }

        throw new \InvalidArgumentException('Valid numeric value expected');
    }