home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / arch / 10791 < prev    next >
Encoding:
Text File  |  1992-11-16  |  827 b   |  25 lines

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