Should I convert FORTRAN code to C?
mcdonald at uxe.cso.uiuc.edu
mcdonald at uxe.cso.uiuc.edu
Fri Jun 10 00:37:00 AEST 1988
I do believe that all this concern over functions in C is misplaced.
There is a long list of math functions, which are essentially intrinsics
- they can be put inline. Included are fabs,sin, cos, tan, asin, acos,
atan, atan2(y,x), sinh, cosh, tanh, exp, log, log10, pow(x,y), sqrt,
and a few lesser ones. These certainly CAN be made inline if the compiler
is smart enough. On my PC, I found after a quick check that only fabs
was inline, but I didnt test all of them. I am ASSUMING of course that
you are talking about ANSI C . All this is in a quite non-controversial
part of it. I asked about the x**2 translation some months ago and was
informed that a compiler can transform pow(x,(double)2) into
a single multiply instruction, if it is smart enough.
Doug McDonald
More information about the Comp.lang.c
mailing list