TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Rob Hamerling
from: Rob Basler
date: 1994-12-02 10:21:04
subject: Need sqrt() algorithm

RH>Quoting (part of) a msg from you of 08 Nov 1994:

RH> RB> I need to do a distance calculation between two points
RH> RB> (x0,z0) and (x1,z1).

RH>If you are going to use the mentioned Newton Raphson method (and why not),
RH>then it helps if the first appromimation is as close as
RH>possible with a simple calculation.

Thanks, using the dimensions of the triangle to calculate limits is
an observation I should use.

RH>And as reaction to the arguments about floating-point support being
RH>'standard' in OS/2, I would say: If the co-ordinates and
RH>the result have to be integer-values, you need 3 type
RH>conversions for every calculation. This might be more
RH>resource consuming than the integer approximation itself!
RH>You would have to write a small 'benchmark'-program to verify this.

I'm actually using fixed point mathematics with 16 bits for the
fractional part.  This is MUCH faster than floating point even with a
coprocessor, especially for addition and subtraction, and gives me the
precision I require.  No type conversion required.

Rob.
___
 X SLMR 2.1a X This tagline is umop apisdn

--- Maximus/2 2.01wb

* Origin: The Idle Task... (604)275-0835 Richmond BC. (1:153/905)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413
SEEN-BY: 711/430 807 808 809 934 942 949 712/353 623 713/888 800/1
@PATH: 153/905 828 7041 3615/50 229/2 12/2442 711/409 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.