protected function _factorial()
    {
        if ($this->value == 0) {
            return new N(1);
        }

        if ($this->value < 0) {
            throw new \RuntimeException(
                'Cannot get factorial of negative number!'
            );
        }

        if (!$this->_decimal()->zero) {
            throw new \RuntimeException(
                'Cannot get factorial of non integer!'
            );
        }

        return new N(array_product(range(1, $this->value)));
    }