home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.os2.programmer:8054 comp.graphics:14250 comp.os.msdos.programmer:12489 comp.sys.ibm.pc.programmer:808
- Newsgroups: comp.os.os2.programmer,comp.graphics,comp.os.msdos.programmer,comp.sys.ibm.pc.programmer
- Path: sparky!uunet!munnari.oz.au!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!ugle.unit.no!nuug!nntp.uio.no!eivind
- From: eivind@kih.no (eivind hagen)
- Subject: Re: Fixed point sqrt anyone?
- Message-ID: <1993Jan27.121349.9076@ulrik.uio.no>
- Followup-To: comp.os.os2.programmer,comp.graphics,comp.os.msdos.programmer,comp.sys.ibm.pc.programmer
- Sender: news@ulrik.uio.no (Mr News)
- Nntp-Posting-Host: samson.kih.no
- Organization: Kongsberg Ingeniorhogskole
- X-Newsreader: TIN [version 1.1 PL8]
- References: <Jan20.020814.50105@yuma.ACNS.ColoState.EDU>
- Date: Wed, 27 Jan 1993 12:13:49 GMT
- Lines: 16
-
- Here's another way of calculating Sqrt, integer.
-
- n1=4
- n2=5
- s1=n1*n1
- s2=n2*n2
-
- These 4 numbers are connected, as are all similar adjacent pairs of integers
- and their squares. Rule : s2=s1+n1+n2
- Use this to move up/down till you reach the desired value in s2, then
- the answer is in n2 (or s1,n1 for that matter...)
-
- I--------------------------------------I-------------------------------------I
- I Eivind Hagen (eivind@samson.kih.no) I "I've got the POWER" I
- I Zynx of Arc Empire I (ARM 3 + cx486slc / 8 MB RAM) I
- I--------------------------------------I-------------------------------------I
-