Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Digit-by-digit calculation of square root

  1. Jun 12, 2012 #1
  2. jcsd
  3. Jun 12, 2012 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Let's call the initial number a. The part already determined form the square root is p.

    The basic idea is like that: For each step, find the next digit such that the squared value (consisting of p plus the new digit) is smaller than a, but the same number with one more as next digit would (squared) give a value larger than a.
    Now, how do we find this digit?

    We already know that p^2<a and the difference d=a-p^2 can be calculated.
    Now we add a small value x/10 to p. This gives (p+x/10)^2=p^2+2px/10+x^2/100 and should be a better approximation to the square root.

    Therefore, we want to find an x with 2px/10+x^2/100 <= d.
    To avoid decimal digits, shift everything by two places, which is equivalent to a multiplication of 100 on both sides:
    20 p x + x^2 <= 100d.
    100d is now called c.
    x (20p+x) <= c
    Which is the formula used by the wikipedia page to find the next digit. Does that help?
     
  4. Jun 12, 2012 #3
    There is an explanation in George Crystal's(sp) Algebra(2 volumes), mine is in a box somewhere, but if you can find a copy it's in there.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Digit-by-digit calculation of square root
  1. Digital Roots (Replies: 2)

Loading...