home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!strath-cs!st-and!tgw
- From: tgw@st-andrews.ac.uk (Trevor Gordon Walker)
- Newsgroups: sci.math
- Subject: Re: Square roots
- Message-ID: <1992Jul29.145036.24876@st-andrews.ac.uk>
- Date: 29 Jul 92 14:50:36 GMT
- References: <Bs4HD3.ID5@usenet.ucs.indiana.edu>
- Followup-To: sci.math
- Organization: St. Andrews University
- Lines: 35
-
- In article <Bs4HD3.ID5@usenet.ucs.indiana.edu> hpassaue@silver.ucs.indiana.edu (Billy Passauer) writes:
- >I ran across this algorithm for finding the square root of a number a
- >long time ago. I was wondering if someone could tell me where I could
- >find more information about it.
- >
- >To find the INTEGER portion of a square root:
- > Take the number you want the square root of, and successively
- >subtract the odd numbers (starting with 1.) Each time the result is
- >positive, add 1 to a counter. Repeat with the new number. When the
- >subtraction yields an odd number, the counter contains the answer.
- >(integer only) For instance the square root of 24:
- >
- > Counter
- > 24 - 1 = 23 : 1
- > 23 - 3 = 20 : 2
- > 20 - 5 = 15 : 3
- > 15 - 7 = 8 : 4
- > 8 - 9 = <0
- >
- >Any information about this would be greatly appreciated.
- >--
- > _
- > /_) * / / / / hpassaue@silver.ucs.indiana.edu
- >/__) / (__ (__ (__/ hpassaue@ucs.indiana.edu
- > Passauer ___/
-
- This is a consequence of the fact that the sum of the first n odd
- numbers is n^2, which is easily proved by induction.
-
- I must admit I had never thought of using the fact in this context,
- though.
-
- Trevor
- trevor@cs.st-and.ac.uk
- tgw@st-and.ac.uk
-