My manual lists everything but intrinsics, is it because the Fortran
standard doesn't define them - so it is system dependant?
Stephen Quan,
Surveying Department,
University of Tasmania.
My Lahey has them listed as follows (I have omitted the
Lahey extensions, and included only those which they
depict as standards);
( I shan't do more than list them....they are VERY long)
Conversion:
INT
IFIX
IDINT
FLOAT
SINGL
REAL
AINT
DINT
ANINT
DNINT
NINT
ININT
IABS
ABS
DABS
CABS
MOD
AMOD
DMOD
ISIGN
SIGN
DSIGN
IDIM
DIM
DDIM
DPROD
MAX0
AMAX1
DMAX1
AMAX0
MAX1
MIN0
AMIN1
DMIN1
AMIN0
MIN1
AIMAG
CONJG
TRANSCENDENTALS:
SQRT
DSQRT
CSQRT
EXP
DEXP
CEXP
ALOG
DLOG
CLOG
ALOG10
DLOG10
TRIG:
SIN
DSIN
CSIN
COS
DCOS
CCOS
TAN
DTAN
ACOS
DACOS
ASIN
DASIN
ATAN
DATAN
ATAN2
DATAN2
HYPERBOLIC:
SINH
COSH
TANH
DSINH
DCOSH
DTANH
CHARACTER:
LGE
LGT
LLE
LLT
LEN
INDEX
CHAR
ICHAR
in general D prefix indicates double precision, C=complex,
etcetera.......
most are pretty excplanatory
Shawn E. Thompson "..my sig file was so long, I'm not even allowed a quote..."
v087...@ubvms.cc.buffalo.edu | s...@autarch.acsu.buffalo.edu
University @ Buffalo|Graduate School of Mechanical Engineering
CAD Engineering|Leica, Inc.|PO Box 123|Buffalo, NY 14240-0123|(716)891-3375
Is this standard? My Fortran guide doesn't mention it. What does it do?
>IDINT
>FLOAT
>SINGL
Are any of these standard?
[...]
>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?
Marc R. Roussel
mrou...@alchemy.chem.utoronto.ca
[..]
>CHARACTER:
>LGE
>LGT
>LLE
>LLT
>LEN
>INDEX
>CHAR
>ICHAR
You beauty! This helps a great deal! For instance, I've replaced 26
IF statements in my uppercase to lowercase conversion routine by one!
- Don't tell me there is an instrinic to do *that* already!
Stephen Quan,
University of Tasmania.
Are any of these standard?
[...]
>MAX0
>AMAX1
>DMAX1
>AMAX0
>MAX1
>MIN0
>AMIN1
>DMIN1
>AMIN0
>MIN1
All these appear in a FORTRAN IV manual (IBM System/360 and System/370
GC28-6515-10 June 1981) I've had for some time. All are listed as `
"ANS FORTRAN Intrinsic functions" whereas simple "MAX" is flagged as
an extension. To list the differences would take too
much typing but for example
MAX and MAX0 perform the same function (extract the maximum form a list of
integers) whereas MAX1 extracts the maximum of a list of reals but returns
an integer (it's not clear from the manual if the integer is obtained by
rounding/chopping/guessing...) and AMAX1 extracts the maximum from a list
of reals.
Hope this is some help.
--------> Peter Monk
***************************
* Dept of Math Sci *
* University of Delaware *
* mo...@math.udel.edu *
***************************
------------------------------------------------------------
=>( I shan't do more than list them....they are VERY long)
The list would be shorter if you limited it to generic function names, which
are the only ones that should be used in new programs.
=>MAX0
=>AMAX1
=>DMAX1
=>AMAX0
=>MAX1
=>MIN0
=>AMIN1
=>DMIN1
=>AMIN0
=>MIN1
All of the above should be replaced by the generic name MAX.
The names you gave are called "specific intrinsic function names" by the
standard. Although they are still recognized, they should not be used in new
programs.
=>TRANSCENDENTALS:
=>SQRT
=>DSQRT
=>CSQRT
=>EXP
=>DEXP
=>CEXP
=>ALOG
=>DLOG
=>CLOG
=>ALOG10
=>DLOG10
=>TRIG:
=>SIN
=>DSIN
. . .
Something is bogus about your classification scheme, besides the fact that you
included specific names like DSQRT.
The SQRT (DSQRT, CSQRT) function, which you list under "transcendentals", is
not transcendental. The trig functions, and several others in your list that
you do not classify as "transcendental," are in fact transcendental.
Transcendental, by definition, means "not algebraic."
--
Dave Seaman
a...@seaman.cc.purdue.edu
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
> mrou...@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 <std.disclaimer> /* 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? |
| dpr...@arco.com | ( - The Clash - ) |
------------------------------------------------------------------------------
[..]
>
> You beauty! This helps a great deal! For instance, I've replaced 26
> IF statements in my uppercase to lowercase conversion routine by one!
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> - Don't tell me there is an instrinic to do *that* already!
>
If you did have an intrinsic to do case conversion, you could count on it not
being part of the ANSI/ISO Fortran77 standard - because lowercase letters
are not part of the standard character set! (Of course, if you were
using C, you could use tolower(), but let's not start up THAT war again...)
> Stephen Quan,
> University of Tasmania.
--
According to your statement, anything NOT algebraic....well
SQRT is not an algebraic function......TRIG functions are....
besides, *I* didn't classify them! I merely copied my Lahey
manual....
>According to your statement, anything NOT algebraic....well
>SQRT is not an algebraic function......TRIG functions are....
this is not correct. An ALGEBRAIC function of one variable is the solution
of a polynomial equation in two variables. Thus
x-y**2=0
has the solution y=sqrt(x). Thus SQRT is an algebraic function. Anything
that is not algebraic is TRANSCENDENTAL.
I offer these comments in the spirit of mathematical nit-picking
In article <52...@eerie.acsu.Buffalo.EDU> v087...@ubvmsa.cc.buffalo.edu writes:
>My Lahey has them listed as follows (I have omitted the
>Lahey extensions, and included only those which they
>depict as standards);
> ...
In article <1990Dec18....@alchemy.chem.utoronto.ca> mrou...@alchemy.chem.utoronto.ca (Marc Roussel) writes:
>IFIX IDINT FLOAT SINGL MAX0 AMAX1 DMAX1 AMAX0 MAX1 MIN0 AMIN1 DMIN1 AMIN0 MIN1
>Are any of these standard?
Neither ININT (which appeared in Shawn's article), nor IDINT, cited by Marc,
nor SINGL are standard. I think ININT is a typo for IDNINT, and SINGL is a typo
for SNGL, both of which are standard.
In addition to those cited by Shawn, MAX, MIN, DBLE and CMPLX are also
required by the f77 standard.
The following names are supposed to be "generic" names, and work with various
argument types: INT, REAL, DBLE, CMPLX, AINT, ANINT, NINT, ABS, MOD, SIGN, DIM,
MAX, MIN, SQRT, EXP, LOG, LOG10, SIN, COS, TAN, ASIN, ACOS, ATAN, ATAN2, SINH,
COSH, and TANH. The rest of the names are specific names for various argument
combinations. In the MAX/MIN world, 0 implies a integer arguments, 1 implies
real arguments; A implies a real result, D implies a double result (and double
arguments). The functions AMAX0/AMIN0 (integer argument, real result) and
MAX1/MIN1 (real argument, integer result) aren't accessible through the generic
MAX/MIN names.
Any Fortran which doesn't have all of these isn't a full Fortran 77.
-- Fred
>If you did have an intrinsic to do case conversion, you could count on it not
>being part of the ANSI/ISO Fortran77 standard - because lowercase letters
>are not part of the standard character set! (Of course, if you were
>using C, you could use tolower(), but let's not start up THAT war again...)
I had a lousy, pain in the neck, search forever kind of bug which simply
turned out to be I was opening files with the letters in wrong cases.
ie. OPEN (11,FILE="XYZ") needed to be changed to OPEN (11,FILE="xyz").
The UNIX platform doesn't support standard Fortran very much does it?!
I suppose that Fortran was meant for systems where filenames were case
insensitive.
...
I had a lousy, pain in the neck, search forever kind of bug which simply
turned out to be I was opening files with the letters in wrong cases.
ie. OPEN (11,FILE="XYZ") needed to be changed to OPEN (11,FILE="xyz").
The UNIX platform doesn't support standard Fortran very much does it?!
If the compiler and runtimes never allowed lower case, linkage to the
host OS (unix) would be so broken that few would be happy.
> turned out to be I was opening files with the letters in wrong cases.
Upper case characters are perfectly allowed in Unix file names .... by
wrong do you mean that you were trying to read a file which had been
created outside of f77, with lowercase characters? If so, how is this
f77's fault ????
There are perfectly valid gripes about Unix, but this would not seem
to be one of them.
I suppose that Fortran was meant for systems where filenames were case
insensitive.
As pointed out by others, x3.9-1978 only _requires_ characters of a
single case. It permits others, and any OS which has them better have
appropriate language support .... as a quality of implementation issue.
--
----------------------------------------------------------------
Keith H. Bierman kbie...@Eng.Sun.COM | k...@chiba.Eng.Sun.COM
SMI 2550 Garcia 12-33 | (415 336 2648)
Mountain View, CA 94043