C vs. FORTRAN (was: What should be added to C)

D Gary Grady dgary at ecsvax.UUCP
Thu May 29 01:21:46 AEST 1986


In article <853 at bentley.UUCP> kwh at bentley.UUCP (KW Heuer) writes:
>In article <1594 at ecsvax.UUCP> ecsvax!dgary (D Gary Grady) writes:
[listing advantages of FORTRAN over C for scientific work]
>>o A richer set of floating point operators, including exponentiation and
>>  the so-called "in-line" functions (many of which ARE in C).
>
>I think you mean "builtin" rather than "inline".  I don't even consider that
>a significant difference, much less an advantage of FORTRAN.

No, I meant "inline."  That's a standard FORTRAN term and I'm surprised
you're not familiar with it.  Anyway, the in-line functions in FORTRAN
include absolute value, imaginary part (of a complex number), real part
(ditto), complex conjugate, explicit truncation, explicit rounding, mod,
sign, positive difference, type conversion, maximum, minimum, and various
Boolean ones.  As I said before, many of these are in C as well, but the
FORTRAN set is certainly richer in those used for scientific coding.
Whether you consider it a significant difference depends on the kind of
programming you do.  As for an explicit exponentiation operator, your
own comments about C's serious limitations constitute an adequate
justification for its addition to the language, I'd say.

>>o A way of passing different-sized multidimensional arrays to the same
>>  subroutine.
>Again, this is merely a syntactic quibble -- what FORTRAN does is equivalent
>to the one-dimensional "trick", but it's hidden from the user.

Quibble?  We're talking about a hard-coded subscript calculation every
time you refer to an array element.  If it isn't hard to add to the
language (and I agree it shouldn't be), why not add it (as long as we
are talking about language modifications - I understand the view that we
should beware Creeping Featurism).  Interesting suggestion you make that
we might as well extend this to malloc'ed arrays.  Hmm...
-- 
D Gary Grady
Duke U Comp Center, Durham, NC  27706
(919) 684-3695
USENET:  {seismo,decvax,ihnp4,akgua,etc.}!mcnc!ecsvax!dgary



More information about the Comp.lang.c mailing list