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