Path: utzoo!utgpu!water!watmath!clyde!feg From: feg@clyde.ATT.COM (Forrest Gehrke) Newsgroups: comp.lang.c Subject: Re: Why I use C instead of fortran Message-ID: <21599@clyde.ATT.COM> Date: 10 Feb 88 20:38:54 GMT References: <11440@brl-adm.ARPA> <3597@sdcc6.ucsd.EDU> <257@tolsun.oulu.fi> <3607@sdcc6.ucsd.EDU> Organization: AT&T Bell Labs, Whippany NJ Lines: 23 In article <3607@sdcc6.ucsd.EDU>, ix426@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@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