Why I use C instead of fortran

Forrest Gehrke feg at clyde.ATT.COM
Thu Feb 11 06:38:54 AEST 1988


In article <3607 at sdcc6.ucsd.EDU>, ix426 at sdcc6.ucsd.EDU (Tom Stockfisch) writes:
> 
> As I believe I said in my posting, I use fortran for complex arithmetic.
> I still write main() and all i/o stuff in C, and use fortran
> subroutines only where the complex arithmetic occurs.  As soon as
> C++ becomes widely available, I won't use fortran at all.  The former's
> complex number facility is far superior to fortran.  For example,
> I can redefine complex division if I think the one provided is too
> slow or not numerically stable enough.
> ||  Tom Stockfisch, UCSD Chemistry   tps at chem.ucsd.edu

Using a simple struct added to stdio.h so that you can
handle the a +j b pair easily, it is no big deal to write the
C subroutines that will do the 4 arithmetic functions plus a square
root and exponential for complex arithmetic. Numerical stability
can be held quite well by keeping all calculations rectilinear,
changing to polar form only if the end result in wanted in that
form.

There is no need to wait for C++ if complex is all you are looking
for.  I would be glad to email if you would like.

Forrest Gehrke



More information about the Comp.lang.c mailing list