home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.arch
- Path: sparky!uunet!ukma!wupost!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!firth
- From: firth@sei.cmu.edu (Robert Firth)
- Subject: Re: integer distance or sqrt
- Message-ID: <1992Nov16.172604.4947@sei.cmu.edu>
- Organization: Software Engineering Institute
- References: <CLIFFC.92Nov15184340@miranda.rice.edu> <1992Nov16.110102.17077@imada.ou.dk>
- Date: Mon, 16 Nov 1992 17:26:04 GMT
- Lines: 14
-
- In article <1992Nov16.110102.17077@imada.ou.dk> breese@monet.imada.ou.dk (Bjoern Reese) writes:
-
- >Heron(x) {Fast integer squareroot routine}
- > IF x <= 64 THEN
- > y = 2 + (x >> 3) {shift right 3 times}
- > ELSE
- ...
- > ENDIF
- > root := (y + x DIV y) >> 1
- >
- >This algorithm is faster than Newton's Method...
-
- Maybe so, but Newton's method doesn't tell you that the square
- root of 0 is 1.
-