Why I use C instead of fortran

Doug Gwyn gwyn at brl-smoke.ARPA
Mon Feb 8 21:50:01 AEST 1988


In article <257 at tolsun.oulu.fi> jto at tolsun.UUCP (Jarkko Oikarinen) writes:
>For serious number-crunching I think FORTRAN is superior to C.
> 1) COMPLEX variables: Write complex arcus hyperbolic tangent in C!

Certainly, things that are built into the language are more convenient.
Complex arithmetic is the only example anyone ever comes up with; by
now all of us C numerical programmers have our own complex arithmetic
support, which we were able to write effectively in C using its data
structuring facilities (in a very simple way -- no linked lists etc.).
In over a dozen years of scientific programming in Fortran, however, I
seldom (I won't say never) had occasion to use COMPLEX arithmetic.
I did, on the other hand, often wish for reasonable support for data
structures!  Now that I have C available, you won't catch me using
Fortran at all (except occasionally in interfacing to existing
Fortran-based applications).

By the way, complex arithmetic was proposed for ANSI C, but it didn't
muster enough support.  I think this was mostly because it would be a
large new invention, and the main argument for it was that it would
make C more palatable to Fortran programmers.  I know I dislike that
type of argumentation, and perhaps so did others..

There are many other types of number (and other mathematical objects)
that neither language supports.  At least with C I can implement my
own support for them.

> 2) single precision: all (ALL) real math is performed in double
>      precision in C.

There were historical reasons for this, but it's fixed in ANSI C.



More information about the Comp.lang.c mailing list