Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!helios!inetg1!dprpjf From: dprpjf@inetg1.Arco.Com (Paul Fowler) Newsgroups: comp.lang.fortran Subject: Re: intrinsic Keywords: intrinsic list Message-ID: <405@inetg1.arco.com> Date: 18 Dec 90 15:17:45 GMT References: <52072@eerie.acsu.Buffalo.EDU> <1990Dec18.035700.6440@alchemy.chem.utoronto.ca> Sender: news@inetg1.arco.com Reply-To: dprpjf@inetg1.Arco.Com (Paul Fowler) Distribution: comp Organization: Arco Oil & Gas Company Lines: 212 In article <1990Dec18.035700.6440@alchemy.chem.utoronto.ca>, mroussel@alchemy.chem.utoronto.ca (Marc Roussel) writes: > In article <52072@eerie.acsu.Buffalo.EDU> v087mxgb@ubvmsa.cc.buffalo.edu writes: > >In article , quan@sol.surv.utas.oz (Stephen Quan) writes... > >>Could anyone give me a list of intrinsic names. > >>eg. > >> COS SIN DCOS DSIN CHAR ... > > > >My Lahey has them listed as follows (I have omitted the > >Lahey extensions, and included only those which they > >depict as standards); > > > >Conversion: > [...] > >IFIX > > > Is this standard? My Fortran guide doesn't mention it. What does it do? Yes. To quote ANSI X3.9-1978 [ = ISO 1539-1980(E), according to the cover], page 15-26: "For a of type real, IFIX(a) is the same as INT(a)" > > >IDINT > >FLOAT > >SINGL > > Are any of these standard? Yes. IDINT is specific intrinsic for double to integer conversion. FLOAT is real to integer (synonym for REAL, as far as I know). SNGL is specific for double to real conversion. > > [...] > >MAX0 > >AMAX1 > >DMAX1 > >AMAX0 > >MAX1 > >MIN0 > >AMIN1 > >DMIN1 > >AMIN0 > >MIN1 > > My Fortran book only mentions MAX and MIN as standard. (We are talking > Fortran 77, aren't we?) What do the 0's and 1's mean? Whose compiler > understands these? > If you want to discuss what is or is not Fortran77, the real reference has to be the standard as cited above. If your compiler supports Fortran77, as defined by ANSI and ISO, then it should understand all of these. > Marc R. Roussel > mroussel@alchemy.chem.utoronto.ca I think the confusion is arising because of the distinction between specific and generic intrinsic functions. For example, as above, IDINT is the specific name for the intrinsic function for converting a double to an integer by truncation. INT is both the specific name of the function for truncating a real to an integer, and also serves as the generic name for the function that converts reals _or_ doubles to integers. In other words, if you use INT(a), the compiler is supposed to figure out whether to use the specific INT or the specific IDINT depending on the type of the argument "a", if I understand the standard correctly. For the record, I append here a list of the generic and specific intrinsic functions as listed in Table 5, page 15-22 of ANSI X3.9-1978. For descriptions and argument types, see the standard or (I hope) your compiler documentation. And please don't ask me to explain the logic behind why some are listed only as generics, some as specifics with no generics, etc. There are probably readers of this group who were on that committee and could explain far better than I could. (Sorry if this list makes for a rather lengthy posting... And I hope I didn't miss any or introduce too many typos!) GENERIC SPECIFIC ============================== INT INT IFIX IDINT ----------------------------- REAL REAL FLOAT SNGL ----------------------------- DBLE ----------------------------- CMPLX ----------------------------- ICHAR CHAR ----------------------------- AINT AINT DINT ----------------------------- ANINT ANINT DNINT ----------------------------- NINT NINT IDNINT ---------------------------- ABS IABS ABS DABS CABS ---------------------------- MOD MOD AMOD DMOD ---------------------------- SIGN ISIGN SIGN DSIGN ---------------------------- DIM IDIM DIM DDIM ---------------------------- DPROD ---------------------------- MAX MAX0 AMAX1 DMAX1 ---------------------------- AMAX0 MAX1 ---------------------------- MIN MIN0 AMIN1 DMIN1 ---------------------------- AMIN0 MIN1 ---------------------------- LEN ---------------------------- INDEX ---------------------------- AIMAG ---------------------------- CONJG ---------------------------- SQRT SQRT DSQRT CSQRT ---------------------------- EXP EXP DEXP CEXP ---------------------------- LOG ALOG DLOG CLOG ---------------------------- LOG10 ALOG10 DLOG10 ---------------------------- SIN SIN DSIN CSIN ---------------------------- COS COS DCOS CCOS ---------------------------- TAN TAN DTAN ---------------------------- ASIN ASIN DASIN ---------------------------- ACOS ACOS DACOS ---------------------------- ATAN ATAN DATAN ---------------------------- ATAN2 ATAN2 DATAN2 ---------------------------- SINH SINH DSINH ---------------------------- COSH COSH DCOSH ---------------------------- TANH TANH DTANH ---------------------------- LGE ---------------------------- LGT ---------------------------- LLE ---------------------------- LLT ---------------------------- -- ------------------------------------------------------------------------------ #include /* These silly opinions are mine alone, etc., etc. */ ------------------------------------------------------------------------------ | Paul Fowler | When they kick at your front door | | ARCO Oil and Gas Co. | How you gonna come? | | Plano, TX | With your hands up on your head | | phone: 214-754-6525 | Or on the trigger of your gun? | | dprpjf@arco.com | ( - The Clash - ) | ------------------------------------------------------------------------------