Fortran vs. C for numerical work

Richard A. O'Keefe ok at goanna.cs.rmit.oz.au
Fri Nov 23 17:08:46 AEST 1990


In article <1990Nov22.051446.1871 at ccu.umanitoba.ca>, salomon at ccu.umanitoba.ca (Dan Salomon) writes:
>     The ANSI standard for function prototypes will
>     give C an edge over FORTRAN in parameter mismatch errors, but
>     that improvement is relatively recent and not enforced yet.

There are several checkers around for Fortran:  several Fortran "lint"
programs (a perennial topic in this newsgroup), PFORT, something in
ToolPack.

>  3) There is a large body of well tested mathematical packages available
>     for FORTRAN, that are not yet available in C.

Given the existence of f2c, any math package available _in_ Fortran is
effectively available in C, and in UNIX and VMS at least, it isn't hard
to call anything that could have been called from Fortran from C.

>  4) FORTRAN still gives the option of using single precision floating
>     calculations for speed and space optimizations, whereas C forces
>     some calculations into double precision.

This is not true of ANSI C, and many vendors provided something like
Sun's "-fsingle" as an option for years before that.  It is also worth
noting that on a number of machines, single-precision calculations are
not faster than double precision.

>  1) C allows recursive functions, whereas portable FORTRAN doesn't.
>     Recursive functions can often solve a problem more clearly
>     than iterative methods, even if they are usually less efficient.

Solved in Fortran Extended.

>  2) FORTRAN has no dynamic array allocation.  Although C has dynamically
>     allocated arrays, they are not trivial to describe or allocate.

Solved in Fortran Extended.  Some vendors have provided pointers of some
sort for several years, and it is easy to fake on some systems.
-- 
I am not now and never have been a member of Mensa.		-- Ariadne.



More information about the Comp.lang.c mailing list