Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: Should I convert FORTRAN code to C? Message-ID: <225800036@uxe.cso.uiuc.edu> Date: 9 Jun 88 14:37:00 GMT References: <2742@utastro.UUCP> Lines: 12 Nf-ID: #R:utastro.UUCP:2742:uxe.cso.uiuc.edu:225800036:000:771 Nf-From: uxe.cso.uiuc.edu!mcdonald Jun 9 09:37:00 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