Fortran vs. C for numerical work (SUMMARY)

David Sielaff ds at juniper09.cray.com
Wed Nov 28 06:29:47 AEST 1990


In article <1990Nov27.175023.26039 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
>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.
>

At the risk of beating a dead horse, the only gotcha here is that
if `static double sin(double);' is seen in a compilation unit, the
compiler had better wait to find the definition in the compilation
unit, and not treat calls to sin() as an intrinsic (after it has seen
the declaration, anyway).  This is a situation which does not arise
in FORTRAN.

Dave Sielaff
Cray Research, Inc.



More information about the Comp.lang.c mailing list