Details

Enhancement

Resolution: Fixed

P4

9

b97

Verified
Description
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.
2) 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].
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.
2) 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].
Attachments
Issue Links
 duplicates

JDK8077587 BigInteger Roots
 Closed
 relates to

JDK4851777 Add BigDecimal sqrt method
 Closed

JDK8014319 Faster division of large integers
 Closed