Loading... (original) (raw)

Two possible square root methods are proposed:

  1. Square Root

public BigInteger sqrt() {}

Returns a BigInteger whose value is (floor(sqrt(this))), where sqrt(.) denotes the mathematical square root of the mathematical value of this.

  1. Square Root with Remainder

Returns an array of two BigIntegers containing (s = floor(sqrt(this))) followed by (this - s^2), where sqrt(.) denotes the mathematical square root of the mathematical value of this.

public BigInteger[] sqrtAndRemainder() {}

A third method such as "BigInteger sqrtRemainder()" is also feasible but would simply be equal to sqrtAndRemainder()[1].