TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Rob Basler
from: Jonathan de Boyne Pollard
date: 1994-11-19 01:52:44
subject: Need sqrt() algorithm

RB>
  >               I don't want to use the standard C sqrt()
  > function because I am not using floating point for anything
  > else.
RB>

  It doesn't matter whether you are or you aren't.  Worrying about
  avoiding floating point doesn't actually gain you very much under
  OS/2.  It's DOS-think.

  If you look, you will find that the run-time libraries that come with
  your C++ compiler don't have separate floating point support options.

  This is because it is safe, under OS/2, to assume that you will
  *always* have an FPU.  If an FPU is not detected, OS/2 traps floating
  point access by an application, and emulates an FPU.  So C++ compilers
  for OS/2 always compile assuming that a 487 is present.

  Since it's pointless to use floating point to implement your own
  sqrt() function (you might as well use the supplied function), your
  only alternative to using sqrt() is implementing your own function
  using integer arithmetic.

  Only if you are convinced that you can implement a sqrt() using
  integer arithmetic that is faster than using the FPU, should you do so.

  > JdeBP <
___
 X MegaMail 2.10 #0:

--- Maximus/2 2.02

* Origin: DoNoR/2,Woking UK (01483-725167) (2:440/4)
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: 440/4 141/209 270/101 396/1 3615/50 229/2 12/2442 711/409 54/54
@PATH: 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™.