public function sqrt() : BigInteger
    {
        if ($this->value[0] === '-') {
            throw new NegativeNumberException('Cannot calculate the square root of a negative number.');
        }

        $value = Calculator::get()->sqrt($this->value);

        return new BigInteger($value);
    }
public function sqrt() : BigInteger
    {
        if ($this->value[0] === '-') {
            throw new NegativeNumberException('Cannot calculate the square root of a negative number.');
        }

        $value = Calculator::get()->sqrt($this->value);

        return new BigInteger($value);
    }
public function sqrt ( ) : BigInteger { if ( $ this -> value [ 0 ] === '-' ) { throw new NegativeNumberException ( 'Cannot calculate the square root of a negative number.' ) ; } $ value = Calculator :: get ( ) -> sqrt ( $ this -> value ) ; return new BigInteger ( $ value ) ; }
Returns the integer square root number of this number, rounded down.

The result is the largest x such that x² ≤ n.

@return BigInteger

@throws NegativeNumberException If this number is negative.
Returns the integer square root number of this number rounded down .