home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / os2 / programm / 7397 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.5 KB

  1. Xref: sparky comp.os.os2.programmer:7397 comp.graphics:13535 comp.os.msdos.programmer:11894
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!sgiblab!adagio.panasonic.com!nntp-server.caltech.edu!manning
  3. From: manning@cco.caltech.edu (Evan Marshall Manning)
  4. Newsgroups: comp.os.os2.programmer,comp.graphics,comp.os.msdos.programmer
  5. Subject: Re: Fixed point sqrt anyone?
  6. Date: 8 Jan 1993 00:02:03 GMT
  7. Organization: California Institute of Technology, Pasadena
  8. Lines: 17
  9. Message-ID: <1iig9rINNkjr@gap.caltech.edu>
  10. References: <1idsq6INNced@flop.ENGR.ORST.EDU>
  11. NNTP-Posting-Host: alumni.caltech.edu
  12.  
  13. murrayk@prism.CS.ORST.EDU (the Dodger) writes:
  14.  
  15. >Well? Does anyone know of a quick and dirty way to get a reasonably accurate
  16. >square root of a fixed point integer number? My numbers are stored in a 16.16
  17. >bit format. I've heard of a few ways, but I'm open for ideas. I just want to
  18. >keep on avoiding floating point for ethical reasons. 8^)
  19.  
  20. It is worth mentioning that often when you think you need a fixed
  21. point sqrt you really don't.  If you are sorting by distance you can
  22. sort by squared distance instead, etc.  Forgive me if I am just
  23. stating the obvious.
  24.  
  25. <<<<<<<<<< Evan M. Manning ======= manning@alumni.caltech.edu >>>>>>>>>>>>
  26. Your eyes are weary from staring at the CRT.  You feel sleepy.  Notice how
  27. restful it is to watch the cursor blink.  Close your eyes.  The opinions
  28. stated above are yours.  You cannot imagine why you ever felt otherwise.
  29. i=3;do{putchar(((0x18|1<<!(i&2)|(!!i==i)*2)<<2|2>>i%2)^(2<<1+i));}while(i--);
  30.