Returns the integer square root number of this number, rounded down.
The result is the largest x such that x² ≤ n.
NegativeNumberException If this number is negative.
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); }