Should I convert FORTRAN code to C?
Jack Shaio
js07 at bunny.UUCP
Thu Jun 30 04:35:50 AEST 1988
In a previous posting, der Mouse replies to:
>
>>> ii) You can define your own data structures,
>> This capability is NOT an adequate replacement for the complex data
>> type. Complex is more than just a pair of reals, [...]
with:
>It's both more and less powerful. To put it another way, FORTRAN's
>COMPLEX data type is NOT an adequate replacement for the ability to
>define custom data types.
>
In fact, the reverse is true: C's ability to define custom data
types is no substitute for FORTRAN's COMPLEX type.
COMPLEX is a standard, and you can link any packaged math subroutine to
your own programs without having to worry about how complex was defined.
I recently obtained three FFT algorithms in C from various sources
and found three different ways of defining complex (all different from mine).
Had I done everything in FORTRAN, a look at the subroutine header would
have been enough.
The point is that if you plan to do numerical work, and not program every
last subroutine from scratch, one COMPLEX data type in FORTRAN is a plus;
ten different definitions of complex in C are a pain. Perhaps a remmant
of the days when people used computers to solve equations.
js
More information about the Comp.lang.c
mailing list