Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8032027

Add BigInteger square root methods

    Details

    • Subcomponent:
    • Resolved In Build:
      b97
    • Verification:
      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].

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bpb Brian Burkhalter
                Reporter:
                bpb Brian Burkhalter
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: