Re: Was there a negative real zero possibility in early Fortran?
- From: Gordon Sande <g.sande@xxxxxxxxxxxxxxxx>
- Date: Sat, 29 Nov 2008 15:22:58 GMT
On 2008-11-29 05:37:35 -0400, Glen Herrmannsfeldt <gah@xxxxxxxxxxxxxxxx> said:
Gordon Sande wrote:
As I recall it, a function ending in F had its one arguement passed in the
accumulator while other functions took an arguement list of the usual form.
As far as I know it, Fortran I used the F and length range to determine
if a name was an array or function. There were no user supplied functions
(no FUNCTION statement).
Fortran II added FUNCTION, SUBROUTINE, and COMMON. It looks like
function names aren't restricted, but the system tape library
functions kept the old names.
I do not recall any discussion of multiple argument functions with names
ending in F. The rule was quite simple and effective so I would guess that
the "mixed" case was not permitted. The CDC6000s were another story with
early arguements in registers and later ones in memory.
From the previously mentioned PDF:
"The FORTRAN II Translator distinguishes a function name with a
parenthesized list of arguments from a subscripted variable by
examining the DIMENSION statements in the program. A subscripted
variable must be listed in a DIMENSION statement, and a function
name must not be so listed. Having determined that an
alphanumeric symbol is a function name, the Translator determines
the type of function by examining the characters used to specify
the function."
"1. A built-in function is specified by a name which is uniquely
reserved for it and listed in a dictionary on the system tape.
"2. A library tape function is specified by its name with a
terminal F added. With the terminal F added, the name consists
of 4 to 7 alphabetic or numeric characters, of which the first
is alphabetic and the last is F. Also, the first must be X if
and only if the value of the function is to be fixed point."
"3. A function defined by an arithmetic statement (function
definition) is specified by the name on the left side of the
function definition. This name is not distinct in from from a
library function name, but is recognized because of its
previous occurrence in a function definition."
"4. A function defined by a FUNCTION subprogram is specified
by a name which is formally distinct from the names of other
types of functions. This name consists of 1 to 6 alphabetic
or numeric characters, the first character must be I, J, K,
L, M, or N if and only if the value of the function is to be
fixed point, and the last character must not be F if the
the total number of characters is 4 or more."
So, the built-in (system tape) functions kept their F, but
those from a FUNCTION subprogram did not, and it seems must not
have the F if they are 4 to 7 characters long.
All true but it is only a formal description and not implementation detail.
I recall that it was possible to write functions in FAP (Fortran Assembly
Program) which which would not have been on the system tape (or disk for
some late 7094s) but did follow the F convention. The loader used the name
without the final F. They had to be in FAP as any compiled FUNCTION would
have used an arguement list. Somewhere there should be a warning about not
using a final F, or perhaps that was a local only fix. The semantics of
library searching were not well established so name conflicts could lead
to obscure problems. Someone who wrote their own SIN thinking that SINF was
the name already in use was going to have trouble.
All of this is in the category of things that deserve to be forgotten.
Then by Fortran IV (more or less Fortran 66) the strange F
convention was gone.
The convention may have been used to supply a different
calling convention. Note, though, that MAX1F takes
multiple arguments and has the F.
-- glen
.
- References:
- Was there a negative real zero possibility in early Fortran?
- From: Terence
- Re: Was there a negative real zero possibility in early Fortran?
- From: Glen Herrmannsfeldt
- Re: Was there a negative real zero possibility in early Fortran?
- From: nmm1
- Re: Was there a negative real zero possibility in early Fortran?
- From: Terence
- Re: Was there a negative real zero possibility in early Fortran?
- From: Glen Herrmannsfeldt
- Re: Was there a negative real zero possibility in early Fortran?
- From: Gordon Sande
- Re: Was there a negative real zero possibility in early Fortran?
- From: Glen Herrmannsfeldt
- Was there a negative real zero possibility in early Fortran?
- Prev by Date: calling a function once works, calling it twice fails
- Next by Date: Re: Intel Fortran Compiler 11.0 Now Available
- Previous by thread: Re: Was there a negative real zero possibility in early Fortran?
- Next by thread: Re: Was there a negative real zero possibility in early Fortran?
- Index(es):
Relevant Pages
|