.ps58,65 .c;SUMMARY OF FORTRAN STATEMENTS .p;The following list describes briefly the syntax and function of PDP-11 FORTRAN statements. The statements are arranged in alphabetical order. A few statements, or parameters, are available only under FORTRAN IV-PLUS, and are so marked. .p;Throughout this list, the following standard parameters are used, and will not necessarily be given any further description in the detailed discussion of the FORTRAN statement: .s .lm10 .ts10 .i-5;e an expression. .i-5;f a format designator, either the label of a FORMAT statement or an array name. .i-5;list an I/O list containing the names of variables, arrays, and array elements whose values are to be transmitted. The I/O list may contain an implied DO list. .i-5;n an integer .i-5;nam the name of a main program, function or subroutine. .i-5;s the label of an executable statement. .i-5;u a logical unit number, either an integer constant or a variable with a positive value. .i-5;v a variable name, including the name of an array element. .lm0 .p;At the end of this document are explanations of arithmetic, relational, and logical expressions, and a summary of available library functions. .p;For complete information on FORTRAN statements, you should obtain the Digital Equipment Corporation manual PDP-11 FORTRAN Language Reference Manual, DEC-11-LPLRA-C-D. .s .page .lm5 .i-5;ACCEPT .br;(See READ) .s .i-5;Arithmetic/Logical Assignment .br;assigns the value of an arithmetic or logical expression e to a variable or array element name v. .s .i+5;v=e .s .i-5;Arithmetc Statement Function .br;creates a user-defined function fn having the variables pi as dummy arguments. When referenced, the expression e is evaluated using the actual arguments in the function call. .br;.s .i5;fn([pl[,p2]...])=e .s .i-5;ASSIGN .br;associates a statement number s with an integer variable v for later use in an assigned GO TO statement. .s .i+5;ASSIGN s TO v .s .i-5;BACKSPACE .br;backspaces the currently open file on logical unit u one record. .s .i5;BACKSPACE u .s .i-5;BLOCK DATA .br identifies the following subprogram, nam, as a BLOCK DATA subprogram. .s .i5;BLOCK DATA [nam] .s .i-5;CALL .br;calls the subroutine nam and passes it the arguments ai to replace the corresponding dummy arguments of the SUBROUTINE definition. .s .i5;CALL nam[([al][,[a2]]...)] .s .br;The arguments ai may be expressions, procedure names, or array names. .s .i-5;CLOSE########{ for FORTRAN IV-PLUS only} .br;disconnects a file from logical unit u. If the DISPOSE argument is included, its value supersedes any DISPOSE included on the OPEN statement for this file. However, a file opened as a scratch file cannot be saved or printed and a file opened as READONLY cannot be printed or deleted. .s .i7;CLOSE (UNIT=u [,DISPOSE=p][,ERR=s]) .s p may have the value 'SAVE', 'DELETE', or 'PRINT'. .s .page .i-5;COMMON .br;reserves a block of storage with common block name cbi for each list of variables nlisti. At most one blank common block may be included. .s .i5;COMMON [/[cbl]/] nlistl [[,]/[cb2]/ nlist2]... .s .br;The items in each list nlisti may be variable names, array names, or array declarators separated by commas. .s .i-5;CONTINUE .br;transfers control to the next executable statement. .s .i5;CONTINUE .s .i-5;DATA .br;assigns initial values to variables and array elements before program execution. Each variable name, array name, or array element name of the list nlisti is assigned the corresponding constant from list clisti. .s .i5;DATA nlistl/clistl/[[,]nlist2/clist2/]... .s .br;Constants in clisti may have the form .s .i5;value .s or .s .i5;n*value .s .br;where n is the number of times this value is to be assigned to successive entities in nlisti. .s .i-5;DECODE .br;translates the characters of entity b (a variable, array, or array element) to internal format and assigns them to the elements in the I/O list. .s .i5;DECODE (c,f,b[,ERR=s]) [list] .s .br;c is an integer expression designating the number of characters to be converted. f, the label of a FORMAT statement or an array name, specifies the format. If an error is encountered, control passes to statement s. .s .i-5;DEFINE FILE .br;specifies the size and structure of a file to be used for direct access I/O. The file on logical unit u contains m records, each of which is n words long. After each direct access I/O operation, the record number of the next higher numbered record in the file is assigned to the integer variable v. .s .i5;DEFINE FILE u (m,n,U,v) [,u (m,n,U,v)]... .page .br;The argument U is required and specifies that the file is a binary file. .s .i-5;DIMENSION .br;specifies storage requirements for one or more arrays. Each array ai must include a dimension declarator di for each array dimension. .s .i5;DIMENSION a#(d#[,d#]...)[,a#(d#[,d#]...)]... .i5;###########1##1###2########2##1###2######### .s.br;In the simplest case each di specifies the number of elements in that dimension. In FORTRAN IV-PLUS only, each di can specify an upper and lower bound in the form of:##[dl:]du. .s .i-5;DO .br;causes the series of statements up through statement s to be executed a designated number of times. .s .i5;DO s [,] v = e1,e2[,e3] .s .br;e1, e2, and e3 are integer expressions denoting the initial and terminal values of the integer variable v and the increment, respectively. .s.br;{FORTRAN IV-PLUS only} v and ei may be integer*2, integer*4, real or double precision with ei converted before use to v's type. .s .i-5 ENCODE .br;changes the elements in the I/O list to characters and places them in the variable, array, or array element denoted by b. .s .i5;ENCODE (c,f,b[,ERR=S]) [list] .s .br;c is an integer expression designating the number of characters to result from the conversion and f is either the label of a FORMAT statement or an array name used to specify the conversion format. Control passes to statement s if an error is encountered. .s .i-5;END .br;delimits the end of a program or subprogram. .s .i5;END .s .i-5;END FILE .br;writes an end-of-file on logical unit u. .s .i5;END FILE u .page .i-5;ENTRY###{for FORTRAN IV-PLUS only} .br;designates an alternate entry point nam and dummy arguments pi within a SUBROUTINE or FUNCTION subprogram. .s .i5;ENTRY nam [([pl[,p2]...])] .s The dummy arguments pi need not match the order, number, type and names of the dummy arguments in the FUNCTION statement, SUBROUTINE statement, or other ENTRY statements, but they must match the actual arguments used in a ^&reference\& to the SUBROUTINE, FUNCTION, or ENTRY statement. .s .i-5;EQUIVALENCE .br;associates two or more entities with the same storage location. Each such entity is a list of two or more variable names, array names, or array element names separated by commas. .s .i+5;EQUIVALENCE (nlist1) [,(nlist2)]... .s .i-5;EXTERNAL .br;defines the name nam to be a FUNCTION or SUBROUTINE subprogram name. .s .i+5;EXTERNAL nam1 [,nam2]... .s .br;Under FORTRAN IV-PLUS ^&only\&, an asterisk may precede nam to designate it as a user-defined subprogram. .s .i-5;FIND .br;positions the direct access file on logical unit u to record r and sets the associated variable of the file to record number r. .s .i+5;FIND (u'r) .s .i-5;FORMAT .br;defines the format in which one or more records are to be transmitted. The FORMAT statement must be labeled. .s .i+5;FORMAT(q#f#s#f#s#...f#q#) .i+5;########1#1#1#2#2####n#n .s.br;qi is zero or more slash (/) record terminators, si is a comma (,) or slash (/) record separator, fi is a field descriptor:##[r]C[w][.d]where .s.br;.i+5;r is a repeat count .i+5;w is the field width, optional for some formats .i+5;d specifies#the number#of charactors#to the##right of .i+10;the decimal point (.) .i+5;C#is#the#format#code: .i+10.br;I,O,L,F,E,D,G,A,NH,'..',nX,Tn,Q,$, or : .page .i-5;FUNCTION .br;begins a FUNCTION subprogram, giving it the name nam and dummy argument names pi. .s .i+5;[typ] FUNCTION nam[*n] [([p1[,p2]...])] .s .br;*n is an optional data type length specifier, and typ is a data type specifier. .s .i-5;GO TO .br;transfers control to an executable statement. The transfer may be unconditional, computed or assigned. An unconditional GO TO has the syntax; .s .i+5;GO TO s .s .br;where s is the label of an executable statement. .s .br;For a computed GO TO, control transfers to the statement label in slist specified by the value of an integer expression e. If e#=#1, control transfers to the first statement in slist; if e#=#2, to the second statement in slist, etc. Syntax of the computed GO TO is: .s .i+5;GO TO (slist)[,] e .s .br;For an assigned GO TO, control transfers to the statement in slist most recently associated with the integer variable name v by an ASSIGN statement. .s .i+5;GO TO v[[,](slist)] .s .i-5;IF .br;executes a statement or transfers control to a statement as determined by evaluating the expression within the IF statement. .s .br;An arithmetic IF has the syntax: .s .i+5;IF (e) s1,s2,s3 .s .br;If the expression e is less that zero, control transfers to statement s1; if e is zero, control transfers to s2; and if e is greater that zero, control transfers to s3. .s .br;A logical IF has the syntax: .s .i+5;IF (e) s .s .br;If the logical expression e is true, statement s is executed. s must not be the label of a DO or logical IF statement. .page .i-5;IMPLICIT .br;specifies that all variables with initial letter ai are of type typ. .s.i+5;IMPLICIT typ (a[,a]...)[,typ(a[,a]...)]... .s The ai may be single letters or a range of letters in alphabetical order separated by a dash (e.g.#A-F). typ may be any of the following: .s .lm10 INTEGER .br;INTEGER*2 .br;INTEGER*4 .br;REAL .br;REAL*4 .br;REAL*8 .br;DOUBLE PRECISION .br;COMPLEX .br;COMPLEX*8 .br;BYTE .br;LOGICAL .br;LOGICAL*1 .br;LOGICAL*4 .s .lm5 Under FORTRAN IV-PLUS ^&only\&, typ may also be LOGICAL*2. .s .i-5;INCLUDE####{FORTRAN#IV-PLUS#only} .br;directs that, at this point, the contents of a designated file are to be incorporated into the compilation. When the end of this alternate file is reached, compilation resumes with the statement following INCLUDE. .s.i+5;INCLUDE'filspec[/[NO[LIST]]' .s;The file specification filspec must be acceptable to the operating system. /NOLIST suppresses inclusion of the statements from filespec in the source listing. /LIST is the default. .s .i-5;OPEN####{FORTRAN#IV-PLUS only} .br;connects an existing file to a logical unit, or creates and connects a new file. .s.i+5;OPEN##(UNIT=e [,p]...) .s The optional parameters p specify file attributes. They are: .page .s.br;^¶meter\&#####^&possible forms\&##########^&function\& .lm37.ts19,37.i-32;NAME NAME=name Assigns a variable, array, or array element name, or alphanumeric literal as the filename. .s .i-32;TYPE TYPE='OLD' Specifies file type. .i-18;TYPE='NEW' .i-18;TYPE='SCRATCH' .i-18;TYPE='UNKNOWN' .s.i-32;ACCESS ACCESS='DIRECT' Specifies access method. .i-18;ACCESS='APPEND' .i-18;ACCESS='SEQUENTIAL' .s.i-32;READONLY READONLY Specifies read-only access. .s.i-32;FORM FORM='FORMATTED' (Default for sequential files) .i-18;FORM='UNFORMATTED' (Default for direct access files) .br;Designates where formatted or unformatted READ and WRITE are to be used. .s.i-32;RECORDSIZE RECORDSIZE=e Logical record length for a direct access file; number of characters if file is formatted, number of storage units if file is unformatted. .s.i-32;ERR ERR=s Transfer control to statement s if an error is encountered. .s.i-32;BUFFERCOUNT BUFFERCOUNT= Number of buffers to be associated with the unit for multi-buffered I/O. Default is 1. .s.i-32;INITIALSIZE INITIALSIZE=e Specifies the number of blocks in the initial allocation of space for a new file on a disk unit. .s.i-32;EXTENDSIZE EXTENDSIZE=e Specifies the number of blocks by which to extend a file if additional storage is needed. Default is 5. .s.i-32;NOSPANBLOCKS NOSPANBLOCKS Specifies that records must not cross disk block boundaries. .page .i-32;SHARED SHARED Allows file to be accessed by more than one program executing simultaneously. .s.i-32;DISPOSE DISPOSE='SAVE' Specifies###disposition###of .i-18;DISPOSE='DELETE' the##file##when##the unit is .i-18;DISPOSE='PRINT' closed. Default is SAVE. PRINT deletes the file after it is printed. .s.i-32;ASSOCIATEVARIABLE .i-18;ASSOCIATEVARIABLE=v .br;At the end of each direct access I/O operation, the integer variable v will contain the record number of the next sequential record in the file. .s.i-32;CARRIAGECONTROL .i-18;CARRIAGECONTROL='FORTRAN' .i-18;CARRIAGECONTROL='LIST' .i-18;CARRIAGECONTROL='NONE' .br;'FORTRAN' specifies normal FORTAN interpretation of the first character; 'LIST' specifies single spacing between records; 'NONE' specifies no implied carriage control. Defaults are 'FORTRAN' for formatted files; 'NONE' for unformatted files. .s.i-32;MAXREC MAXREC=e Maximum number of records to be permitted in a direct access file. Default is no maximum. .s.i-32;BLOCKSIZE BLOCKSIZE=e Physical block size for magnetic tape files. .lm5 .s .i-5;PARAMETER##{FORTRAN IV-PLUS only} .br;allows a constant c to be given a symbolic name p. The symbolic name can then appear in any position that a constant is allowed. .s.i+5;PARAMETER pl=cl [,p2=c2]... .page .i-5;PAUSE .br;temporarily suspends program execution to permit some user action. .s.i+5;PAUSE [disp] .s.br;The contents of the display, if one is specified, are printed at the user's terminal. The display may be one to five decimal digits, an alphanumeric literal, or an octal constant. .s.i-5;PRINT .br;(see formatted sequential WRITE and list-directed WRITE) .s.i-5;PROGRAM .br;assigns the name nam to the main program. .s.i+5;PROGRAM#nam .s.i-5;READ .br;performs input of FORTRAN data. There are several types of READ statement--unformatted sequential, formatted sequential, unformatted direct access, and for FORTRAN IV-PLUS only, formatted direct access and list-directed sequential. .s .br;The unformatted sequential READ statement reads one unformatted record from logical unit u and assigns values to the elements in the list. .s .i+5;READ (u[,END=s]#[,ERR=s])[list] .s .br;The formatted sequential READ statement reads one or more logical records from unit u and assigns values to the elements in the list, converting them according to format specification f. The parameter f may be the label of a FORMAT statement or an array name. .s.i+5;READ (u,f[,END=s][,ERR=s])[list] .i+5;READ f[,list] .i+5;ACCEPT f[,list] .s .br;ACCEPT expects the data to be read from a logical unit connected to the terminal keyboard. .s.br;The unformatted direct access READ statement reads record r from unit u and assigns values to the elements in the list. .s.i+5;READ (u'r[,ERR=s])[list] .page.br;The formatted direct access READ, available under FORTRAN IV-PLUS only, reads record r from unit u and assigns values to the elements in list, converted according to format specification f. .s.i+5;READ (u'r,f[,ERR=s])[list] .s.br;The list-directed sequential read, available under FORTRAN IV-PLUS only, reads one or more logical records from unit u and assigns values to the elements in the list, converted according to the data type of the list element. .s.i+5;READ (u,*[,END=s][,ERR=s])list .i+5;READ#*,list .i+5;ACCEPT#*,list .s.i-5;RETURN .br;returns control from the current subprogram back to the calling program. .s.i+5;RETURN .s.i-5;REWIND .br;repositions logical unit u to the beginning of the currently opened file. .s.i+5;REWIND u .s.i-5;STOP .br;terminates program execution and prints the display, if one has been specified. The display may be a string of one to five decimal digits, an alphanumeric literal, or an octal constant. .s.i+5;STOP [disp] .s .i-5;SUBROUTINE .br;begins a SUBROUTINE subprogram, assigning it the name nam and any dummy argument names p. .s.i+5;SUBROUTINE nam [([p[,p]...])] .s.i-5;TYPE .br;(see WRITE) .s .i-5;Type Declaration .br;assigns one or more symbolic names, v, to a specified data type. A symbolic name can be followed by a length specifier in the form *s, where s is an acceptable for the data type, and overrides the length attribute implied by the type declaration. .s.i+5;typ v[,v]... .page.br;typ may be any of the following: .s .i+5;DOUBLE#PRECISION .i+5;COMPLEX .i+5;COMPLEX*8 .i+5;REAL .i+5;REAL*4 .i+5;READ*8 .i+5;INTEGER .i+5;INTEGER*2 .i+5;INTEGER*4 .i+5;BYTE .i+5;LOGICAL .i+5;LOGICAL*1 .i+5;LOGICAL*4 .i+5;LOGICAL*2##(for FORTRAN IV-PLUS only) .s.i-5;WRITE .br;performs output from the FORTRAN program. A TYPE statement assumes the output unit is connected to the user's terminal, and a PRINT statement assumes it is connected to the line printer. There are several types of WRITE statements--unformatted sequential, formatted sequential, unformatted direct access, and, for FORTRAN IV-PLUS only, formatted direct access and list-directed sequential. .s.br;An unformatted sequential WRITE statement writes one unformatted record to unit u containing the values of the elements in the list. .s.i+5;WRITE (u[,ERR=s])[list] .s.br;A formatted sequential WRITE statement writes one or more logical records to unit u containing the values of the elements in the list, converted according to format specification#f, where f may be a FORMAT statement label or array name. .s.i+5;WRITE (u,f[,ERR=s])[list] .i+5;PRINT f[,list] .i+5;TYPE f[,list] .s.br;An unformatted direct access WRITE statement writes record r to unit u containing the values of the elements in the list. .s.i+5;WRITE (u'r[,ERR=s])[list] .s.br;The formatted direct access WRITE, available under FORTRAN IV-PLUS only, writes record r to unit u containing the values of the elements in the list, converted according to format specification f. .s.i+5;WRITE (u'r,f[,ERR=s])[list] .page.br;The list-directed sequential WRITE, available under FORTRAN IV-PLUS only, writes one or more logical records to unit u containing the values of the elements in the list, converted according to the data type of the list element. .s.i+5;WRITE(u,*[,ERR=s])list .i+5;PRINT *,list .i+5;TYPE *,list .s2 .page.lm0 ^&Syntax of FORTRAN Expressions\& .s2 Arithmetic expressions operate on arithmetic or logical constants, variables, and expressions. The arithmetic operators, in order of descending precedence, are: .s.i+5;**###exponentiation .i+5;*,/##multiplication, division .i+5;+,-##addition, subtraction (unary plus and minus) .s Relational expressions operate on arithmetic or logical constants, variables, and expressions. The relational operators are: .s.i+5;_.GT.#greater than .i+5;_.GE.#greater than or equal .i+5;_.LT.#less than .i+5;_.LE.#less than or equal .i+5;_.EQ.#equal to .i+5;_.NE.#not equal to .s The relational operators have equal priority. .s;Logical expressions operate on logical or integer constants, variables, and expressions. The logical operators, in order of descending precedence, are: .lm14.ts14 .s.i-7;_.NOT. true if the operand is false. .i-7;_.AND. true if both operands are true. .i-7;_.OR. inclusive OR, true if either or both operands are true. .i-7;_.EQV. true if both operands are true or both operands are false. .i-7;_.XOR. exclusive OR, true if one but not both operands are true. .lm5 .s.br;The operators _.EQV. and _.XOR. have equal precedence. .page .lm0 .s;^&Syntax of FORTRAN Library Functions\& .ps58,70 .s.lm36.ts15,26,36 .i-21;ARGUMENT RESULT .br.i-36;^&SYNTAX ____TYPE____ __TYPE__ ########MEANING\& .s;Absolute Value Functions: .s.i-36;ABS(X) Real Real Real absolute value .i-36;IABS(I) Integer Integer Integer absolute value .i-36;DABS(X) Double Double Double precision absolute value .i-36;CABS(Z) Complex to Real, absolute value .br;##where Z=(x,y) .i-21;Complex Real ##CABS(Z)=(x#+y#)1/2 .br;############2##2 .i-36;_____________________________________________________________________________________________________________________________________________ .s;Conversion Functions: .s.i-36;FLOAT(I) Integer Real Integer to Real conversion .i-36;IFIX(X) Integer to Real conversion .i-21;Real Integer ##IFIX(X) is equivalent to INT(X) .i-36;SNGL(X) Double Real Double to Real conversion .i-36;DBLE(X) Real Double Real to Double conversion, .i-36;REAL(Z) Complex to Real conversion, .i-21;Complex Real ##obtain real part .i-36;AIMAG(Z) Complex to Real conversion, .i-21;Complex Real ##obtain imaginary part .i-36;CMPLX(X,Y) Real to Complex conversion .i-21;Real Complex ##CMPLX(X,Y)=X+i*Y .i-36;_____________________________________________________________________________________________________________________________________________ .s;Truncation functions: .s.br;Truncation functions return the sign of the argument * largest integer < |arg| .s.i-36;AINT(X) Real Integer Real to Real truncation .i-36;INT(X) Real Real Real to Integer truncation .i-36;IDINT(X) Double Integer Double to Integer truncation .i-36;_____________________________________________________________________________________________________________________________________________ .s;Remainder Functions: .s.br;Remainder functions return the remainder when the first argument is divided by the second. .s.i-36;AMOD(X,Y) Real Real Real remainder .i-36;MOD(I,J) Integer Integer Integer remainder .i-36;DMOD(X,Y) Double Double Double precision remainder .i-36;_____________________________________________________________________________________________________________________________________________ .page .i-21;ARGUMENT RESULT .i-36;^&SYNTAX ____TYPE____ __TYPE__ ########MEANING\& .s;Maximum Value Functions: .s.br;Maximum value functions return the largest value from among the argument list; at least 2 arguments are required. .s.i-36;AMAX0(I,J,...) Integer Real Real maximum from Integer list .i-36;AMAX1(X,Y,...) Real Real Real maximum from Real list .i-36;MAX0(I,J,...) Integer Integer Integer maximum from Integer list .i-36;MAX1(X,Y,...) Real Integer Integer maximum from Real list .i-36;DMAX1(X,Y,...) Double Double Double maximum from Double list .i-36;_____________________________________________________________________________________________________________________________________________ .s;Minimum Value Functions: .s.br;Minimum value functions return the smallest value from among the argument list; at least 2 arguments are required. .s.i-36;AMINO(I,J,...) Integer Real Real minimum of Integer list .i-36;AMIN1(X,Y,...) Real Real Real minimum of Real list .i-36;MIN0(I,J,...) Integer Integer Integer minimum of Integer list .i-36;MIN1(X,Y,...) Real Integer Integer minimum of Real list .i-36;DMIN1(X,Y,...) Double Double Double minimum of Double list .i-36;_____________________________________________________________________________________________________________________________________________ .s;Transfer of Sign Function: .s.br;The transfer of sign functions return (sign of the second argument)#*#(absolute value of first argument). .s .i-36;SIGN(X,Y) Real Real Real transfer of sign .i-36;ISIGN(I,J) Real Real Integer transfer of sign .i-36;DSIGN(X,Y) Double Double Double precision transfer of sign .i-36;_____________________________________________________________________________________________________________________________________________ .s;Positive Difference Functions: .s.br;Positive difference functions return the first argument minus the minimum of the two arguments. .s.i-36;DIM(X,Y) Real Real Real positive difference .i-36;IDIM(I,J) Integer Integer Integer positive difference .i-36;_____________________________________________________________________________________________________________________________________________ .page .i-21;ARGUMENT RESULT .i-36;^&SYNTAX ____TYPE____ __TYPE__ ########MEANING\& .s;Exponential Functions: .s.br;Exponential functions return the value of e raised to the argument power. .s.br;#x .i-36;EXP(X) Real Real e .br;#x .i-36;DEXP(X) Double Double e .br;#x .i-36;CEXP(Z) Complex Complex e .i-36;_____________________________________________________________________________________________________________________________________________ .s;Log Functions: .s.i-36;ALOG(X) Real Real Returns log#(X) .br;###########e .I-36;ALOG10(X) Real Real Returns log##(X) .br;###########10 .i-36;DLOG(X) Double Double Returns log#(X) .br;###########e .i-36;DLOG10(X) Double Double Returns log##(X) .br;###########10 .I-36;CLOG(Z) Complex Complex Returns log# of complex argument .br;###########e .i-36;_____________________________________________________________________________________________________________________________________________ .s;Square Root Functions: .s.i-36;SQRT(X) Real Real Square root of Real argument .i-36;DSQRT(X) Double Double Square root of Double precision argument .i-36;CSQRT(Z) Complex Complex Square root of Complex argument .i-36;_____________________________________________________________________________________________________________________________________________ .s;Sine Functions: .s.i-36;SIN(X) Real Real Real sine .i-36;DSIN(X) Double Double Double precision sine .i-36;CSIN(Z) Complex Complex Complex sine .i-36;_____________________________________________________________________________________________________________________________________________ .s;Cosine Functions: .s.i-36;COS(X) Real Real Real cosine .i-36;DCOS(X) Double Double Double precision cosine .i-36;CCOS(Z) Complex Complex Complex cosine .i-36;_____________________________________________________________________________________________________________________________________________ .page .i-21;ARGUMENT RESULT .i-36;^&SYNTAX ____TYPE____ __TYPE__ ###########MEANING\& .s;Tangent Functions: .s.i-36;TANH(X) Real Real Hyperbolic tangent .i-36;_____________________________________________________________________________________________________________________________________________ .s .i-36;ATAN(X) Real Real Real arc tangent .i-36;DATAN(X) Double Double Double precision arc tangent .i-36;ATAN2(X,Y) Real Real Real arc tangent of (X/Y) .i-36;DATAN2(X,Y) Double Double Double precision arc tangent .br;(X/Y) .i-36;_____________________________________________________________________________________________________________________________________________ .s;Complex Conjugate Function: .s.i-36;CONJG(Z) Complex complex If Z=X+i*y, CONJG(Z)=X-i*Y .i-36;____________________________________________________________________________________________________________________________________________ .s;Random Number Function: .s.i-36;RAN(I,J) Integer Real Returns a random number of uniform distribution over the range 0 to 1. I and J must be integer variables and should be set initially to 0. Resetting I and J to 0 regenerates the random number sequence. Alternate starting values for I and J will generate different random number sequences. See also Appendix C.3. .i-36;____________________________________________________________________________________________________________________________________________ .page.ps 58,75.lm0 .br;^&FORTRAN IV-PLUS Generic and Processor-Defined Functions\& .ts10,18,28,41,52 .s2 ^&Generic PDF Internal Argument Result Meaning .br;#Name Name Name Type(s) Type\& .s Absolute Value: .s.br;ABS ABS $ABS Real Real |a| .br; DABS $DABS Double Double .br; CABS $CABS Complex Real .br; IIABS $IABS Integer-2 Integer-2 .br; JIABS $JABS Integer-4 Integer-4 _____________________________________________________________________________________________________________________________________________________ .s .br;IABS IIABS $IABS Integer-2 Integer-2 .br; JIABS $JABS Integer-4 Integer-4 _____________________________________________________________________________________________________________________________________________________ .s .br; Cosine: .s.br;COS COS $COS Real Real Cos a .br; DCOS $DCOS Double Double .br; .br; CCOS $CCOS Complex Complex _____________________________________________________________________________________________________________________________________________________ .s .br; Exponential: .s; #a .br;EXP EXP $EXP Real Real E# .br; DEXP $DEXP Double Double .br; CEXP $CEXP Complex Complex _____________________________________________________________________________________________________________________________________________________ .s .br; Natural Logarithm: .s.br;LOG ALOG $ALOG Real Real log a .br; DLOG $DLOG Double Double ###e .br; CLOG $CLOG Complex Complex _____________________________________________________________________________________________________________________________________________________ .s; Common Logarithm: .s.br;LOG10 ALOG10 $ALG10 Real Real log##a .br; DLOG10 $DLG10 Double Double ###10 _____________________________________________________________________________________________________________________________________________________ .s; Sine: .s.br;SIN SIN $SIN Real Real Sin a .br; DSIN $DSIN Double Double .br; CSIN $CSIN Complex Complex _____________________________________________________________________________________________________________________________________________________ .page ^&Generic PDF Internal Argument Result Meaning .br;#Name Name Name Type(s) Type\& .s; Square Root: .s; ##1/2 .br;SQORT SQRT $SQRT Real Real a .br; DSQRT $DSQRT Double Double .br; CSQRT $CSQRT Complex Complex _____________________________________________________________________________________________________________________________________________________ .s; Tangent: .s.br;TAN TAN $TAN Real Real Tan a .br; DTAN $DTAN Double Double _____________________________________________________________________________________________________________________________________________________ .s; Arc Cosine: .s.br;ACOS ACOS $ACOS Real Real Arc Cos a .br; DACOS $DACOS Double Double _____________________________________________________________________________________________________________________________________________________ .s; Arc Sine: .s.br;ASIN ASIN $ASIN Real Real Arc Sin a .br; DASIN $DASIN Double Double _____________________________________________________________________________________________________________________________________________________ .s; Arc Tangent: .s.br;ATAN ATAN $ATAN Real Real Arc Tan a .br; DATAN $DATAN Double Double _____________________________________________________________________________________________________________________________________________________ .s .br;ATAN2 ATAN2 $ATAN2 Real Real Arc Tan a#/a .br; DATAN2 $DATN2 Double Double #########1##2 _____________________________________________________________________________________________________________________________________________________ .s; Hyperbolic Cosine: .s.br;COSH COSH $COSH Real Real Cosh#a .br; DCOSH $DCOSH Double Double _____________________________________________________________________________________________________________________________________________________ .s; Hyperbolic Sine: .s.br;SINH SINH $SINH Real Real Sinh#a .br; DSINH $DSINH Double Double _____________________________________________________________________________________________________________________________________________________ .page .br;^&Generic PDF Internal Argument Result Meaning\& .br;^&#Name Name Name Type(s) Type\& .s; Hyperbolic Tangent: .s.br;TANH TANH $TANH Real Real Tanh#a .br; DTANH $DTANH Double Double _____________________________________________________________________________________________________________________________________________________ .s; Positive Difference: .s.br;DIM IIDIM $IDIM Integer-2 Integer-2 a#-(min(a#,a#)) .br; JIDIM $JDIM Integer-4 Integer-4 #1#######1##2 .br; DIM $DIM Real Real .br; DDIM $DDIM Double Double _____________________________________________________________________________________________________________________________________________________ .s .br;IDIM IIDIM $IDIM Integer-2 Integer-2 .br; JIDIM $JDIM Integer-4 Integer-4 _____________________________________________________________________________________________________________________________________________________ .s; Float: .s.br;FLOAT FLOATI $FLOAT Integer-2 Real Integer to Real .br; FLOATJ $FLOATJ Integer-4 Real Conversion _____________________________________________________________________________________________________________________________________________________ .s; Double Precision Float: .s.br;DFLOAT DFLOTI $DFLTI Integer-2 Double Integer to Double .br; DFLOTJ $DFLTJ Integer-4 Double Conversion _____________________________________________________________________________________________________________________________________________________ .s; Fix: .s.br;IFIX* IIFIX $IFIX Real Integer-2 Real to Integer .br; JIFIX $JFIX Real Integer-4 Conversion _____________________________________________________________________________________________________________________________________________________ .s; Conversion to Single .s.br; SNGL $SNGL Double Real .br;SINGL ##- ##- Real Real .br; FLOATI $FLOAT Integer-2 Real .br; FLOATJ $FLOTJ Integer-4 Real _____________________________________________________________________________________________________________________________________________________ .s.br; *#=#Result Generic .page;^&Generic PDF Internal Argument Result Meaning .br;#Name Name Name Type(s) Type\& .s; Conversion to Double .s.br; DBLE $DBLE Real Double .br;DBLE ##- ##- Double Double .br; DFLOTI $DFLTI Integer-2 Double .br; DFLOTJ $DFLTJ Integer-4 Double _____________________________________________________________________________________________________________________________________________________ .s; Real Part of Complex .s.br; REAL $REAL Complex Real _____________________________________________________________________________________________________________________________________________________ .s; Imaginary Part .br; of Complex .s.br; AIMAC $AIMAG Complex Real _____________________________________________________________________________________________________________________________________________________ .s; Complex From .br; two Reels .s.br; CMPLX $CMPLX Real Complex _____________________________________________________________________________________________________________________________________________________ .s; Complex Conjugate .s.br; CONJG $CONJG Complex Complex _____________________________________________________________________________________________________________________________________________________ .s; Double Product .br; of Reels .s.br; DPROD $DPROD Real Double _____________________________________________________________________________________________________________________________________________________ .s; Remainder: .s.br;MOD IMOD $IMOD Integer-2 Integer-2 Remainder when .br; JMOD $JMOD Integer-4 Integer-4 a##divided by a# .br; AMOD $AMOD Real Real #1#############2 .br; DMOD $DMOD Double Double _____________________________________________________________________________________________________________________________________________________ .s.br; *#=#Result Generic .page .br;^&Generic PDF Internal Argument Result Meaning\& .br;^&#Name Name Name Type(s) Type\& .s; Transfer of Sign: .s.br;SIGN IISIGN $ISIGN Integer-2 Integer-2 Sign a#*|a#| .br; JISIGN $JSIGN Integer-4 Integer-4 ######2###1 .br; SIGN $SIGN Real Real .br; DSIGN $DSIGN Double Double _____________________________________________________________________________________________________________________________________________________ .s .br;ISIGN IISIGN $ISIGN Integer-2 Integer-2 .br; JSIGN $JSIGN Integer-4 Integer-4 _____________________________________________________________________________________________________________________________________________________ .s; Maximum: .s.br;MAX IMAX0 $MAX0 Integer-2 Integer-2 max(a#,a#...a#) .br; JMAX0 $JMAX0 Integer-4 Integer-4 #####1##2####n .br; AMAX1 $AMAX1 Real Real .br; DMAX1 $DMAX1 Double Double _____________________________________________________________________________________________________________________________________________________ .s .br;MAX0 IMAX0 $MAX0 Integer-2 Integer-2 .br; JMAX0 $JMAX0 Integer-4 Integer-4 _____________________________________________________________________________________________________________________________________________________ .s .br;MAX1* IMAX1 $MAX1 Real Integer-2 .br; AJMAX0 $JMAX0 Real Integer-4 _____________________________________________________________________________________________________________________________________________________ .s;AMAX0 AIJAX0 AMAX0 Integer-2 Real .br;AJMAX0 AJMAX0 Integer-4 Real ______________________________________________________________________________________________________________________________________________________ .s; Minimum: .s.br;MIN IMIN0 $MIN0 Integer-2 Integer-2 min(a#,a#...a#) .br; JMIN0 $JMIN0 Integer-4 Integer-4 #####1##2####n .br; AMIN1 $AMIN1 Real Real .br; DMIN1 $DMIN1 Double Double _____________________________________________________________________________________________________________________________________________________ .s .br;MIN0 IMIN0 $MIN0 Integer-2 Integer-2 .br; JMIN0 $JMIN0 Integer-4 Integer-4 _____________________________________________________________________________________________________________________________________________________ .s.br; *#=#Result Generic .page .br;^&Generic PDF Internal Argument Result Meaning\& .br;^&#Name Name Name Type(s) Type\& .s MIN1* IMIN1 $MIN1 Real Integer-2 .br; JMIN1 $JMIN1 Real Integer-4 _____________________________________________________________________________________________________________________________________________________ .s .br;AMIN0 AIMIN0 $AMIN0 Integer-2 Real .br; AJMIN0 $AJMN0 Integer-4 Real _____________________________________________________________________________________________________________________________________________________ .s; Truncation: .s.br;INT* IINT $INT Real Integer-2 [a] .br; JINT $JNT Real Integer-4 .br; IIDINT $IDINT Double Integer-2 .br; JIDINT $JDINT Double Integer-4 _____________________________________________________________________________________________________________________________________________________ .s .br;AINT AINT $AINT Real Real .br; DINT $DINT Double Double _____________________________________________________________________________________________________________________________________________________ .s; Nearest Integer: .s.br;NINT* ININT $NINT Real Integer-2 [a+.5*Sign(a)] .br; JNINT $NJNT Real Integer-4 .br; IIDNNT $IDNNT Double Integer-2 .br; JIDNNT $JDNNT Double Integer-4 _____________________________________________________________________________________________________________________________________________________ .s .br;IDNINT* IIDNNT $IDNNT Double Integer-2 .br; JIDNNT $JDNNT Double Integer-4 _____________________________________________________________________________________________________________________________________________________ .s .br;ANINT ANINT $ANINT Real Real .br; DNINT $DNINT Double Double _____________________________________________________________________________________________________________________________________________________ .s; Bitwise AND .s.br;IAND IIAND $IAND Integer-2 Integer-2 .br; JIAND $JAND Integer-4 Integer-4 _____________________________________________________________________________________________________________________________________________________ .s; *#=#Result Generic .page .br;^&Generic PDF Internal Argument Result Meaning\& .br;^&#Name Name Name Type(s) Type\& .s; Bitwise Inclusive OR .s.br;IOR IIOR $IOR Integer-2 Integer-2 .br; JIOR $JOR Integer-4 Integer-4 _____________________________________________________________________________________________________________________________________________________ .s; Bitwise Exclusive OR .s.br;IEOR IIEOR $IEOR Integer-2 Integer-2 .br; JIEOR $JEOR Integer-4 Integer-4 _____________________________________________________________________________________________________________________________________________________ .s; Bitwise Complement .s.br;NOT INOT $INOT Integer-2 Integer-2 .br; JNOT $JNOT Integer-4 Integer-4 ______________________________________________________________________________________________________________________________________________________ .s; Bitwise shift: .s.br;ISHFT IISHFT $ISHFT Integer-2 Integer-2 a##logically shifted .br; JISHFT $JSHFT Integer-4 Integer-4 #1 .br; left a##bits .br; ######2 _____________________________________________________________________________________________________________________________________________________ .s; *#=#Result Generic .page .c;^&FORTRAN IV-Plus Functions\& .s.lm+5.ts5.ps 58,65 .i-5;l. [x] is defined as the largest integer whose magnitude does not exceed the magnitude of x and whose sign is the same as that of x. .s .i-5;2. The remaindering functions of (a#,#a#) are defined as .br;################################1###2# .br;a##-#[a#/a#]a#,#where [x] is defined in 1. above. .br;#1#####2##2 .s .i-5;3. Functions that cause conversion of an entity from one type to another type provide the same effect as the implied conversion in assignment statements. The functions SNGL with a real argument, and DBLE with a double precision argument, return the value of the argument without conversions. .s .i-5;4. A complex value is expressed as an ordered pair of reals (ar, ai), where ar is the real part and ai is the imaginary part. .s .i-5;5. The argument of ALOG, DLOG, ALOG10, and DLOG10 must be greater than zero. The argument of CLOG must not be (0.,0.). .s .i-5;6. The argument of SIN, DSIN, COS, DCOS, TAN, and DTAN must be in radians. These functions use the argument module 2 pi. .s .i-5;7. The argument of SQRT and DSQRT must be greater than or equal to zero. .s .i-5;8. The absolute value of the argument of ASIN, DASIN, ACOS, and DACOS must be less than or equal to one. .s .i-5;9. The result of ASIN, DASIN, ACOS, DACOS, ATAN, DATAN, ATAN2, and DATAN2 is in radians. .s .i-5;10. The result of ATAN2 and DATAN2 is zero or positive for a#&<0 .br;########################################################2 and##negative for##a#<0. The##result is##undefined if both .br;####################1 .br;arguments are zero. .s .i-5;11. The result of CSQRT is the principal value with the real part greater than or equal to zero. When the real part is zero, the imaginary part is greater than or equal to zero. .s .i-5;12. The principal value is used for the results of complex functions.