Fortran vs. C for numerical work (SUMMARY)

Henry Spencer henry at zoo.toronto.edu
Wed Nov 28 04:50:23 AEST 1990


In article <BGLENDEN.90Nov26162335 at mandrill.cv.nrao.edu> bglenden at mandrill.cv.nrao.edu (Brian Glendenning) writes:
>3. In fortran functions like sin, cos, ** are intrinsic.
>
>I think that ANSI C has a method by which compilers may make sin, cos
>etc intrinsic, but I don't remember how it works...

It's really very simple:  they are allowed to be intrinsic, essentially.
There is no complexity or mystery.  C and Fortran are no longer different
in this regard, except insofar as the Fortran libraries are larger.

>6. C can ignore the placement of parentheses

Not any more.  This too is an obsolete argument.

>7. "C has too many system dependent aspects (e.g. round up or down when
>   dividing negative integers)."

A lot of the purportedly "system dependent aspects" also exist in Fortran.
This particular one doesn't, but that is a concession to efficiency in an
area that rarely matters to programmers.  What it is, in fact, is permission
to the hardware to do things the wrong way because Fortran wants it that way!
People who use this argument are missing an important point:  C may have
system-dependent aspects, but well-crafted C programs do not.  Those who
believe that Fortran programs are automatically system-independent have
not tried to port very many amateur-written Fortran programs.  (Programs
written by competent professionals avoid these problems regardless of the
choice of language.)
-- 
"I'm not sure it's possible            | Henry Spencer at U of Toronto Zoology
to explain how X works."               |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list