Scor­pio News

  

January–March 1987 – Volume 1. Issue 1.

Page 11 of 63

DOUBLE PRECISION types are real data with an accuracy of greater than 16 significant digits with the same range as real data.

LOGICAL types are single byte representations of .TRUE. or .FALSE., with .FALSE. equivalent to zero and .TRUE. has a value of −1; in practice, any non-zero value will be treated as TRUE. in a logical IF statement.

HOLLERITH types (named in honour of the inventor of the punched card tabulator) consist of a string of any number of characters from the computer’s character set. They are sometimes known as &lsquoTEXT’ or ‘LITERAL’ types.

F80 does not support COMPLEX data types, but ProFortran does. A COMPLEX variable has two components – a real part and an imaginary part – each of type REAL.

FOR­TRAN constants are of types INTEGER, REAL, DOUBLE PRECISION, LOGICAL, HOLLERITH and, additionally in F80, HEXADECIMAL.

The INTEGER type has from 1 – 5 decimal digits together with a ‘-’ sign if appropriate. e.g 521, 2, −45, 00012

REAL types have 7 digit precision and are represented either in floating point (F) or exponent (E) format. For example, 3.21456 is a floating point REAL constant and 0.321456E 1 is the exponent equivalent – as in BASIC the use of the ‘E’ indicates ‘10 to the power’ and the figure that follows is the index of the power – in this case, 1. REAL numbers can be positive or negative and must have a decimal point. They will be truncated if the number of figures exceeds the stated level of precision.

DOUBLE PRECISION type constants have a higher Level of precision and obey the rules for REAL numbers – but with more significant figures or the use of ‘D’ in the exponent format – thus 4.172345860098 is a double precision number as is –.786D 4

LOGICAL constants are either .TRUE. or .FALSE. and generate FF (hex) and 0 (hex).

LITERAL constants are strings of any character except the single quote ('), enclosed by single quotes. 'QWERTYUIOP' is one such constant.

HEXADECIMAL constants are found in F80 but rarely in other FOR­TRAN versions. The constant consists of up to 4 hexadecimal digits enclosed in single quotes and preceded by a Z or X Z. Z'FA12' and X'2C' are examples.

FOR­TRAN variables are identified by symbolic names which are strings of 1 to 6 alphanumeric characters which are unique to the program in which they are used. The first character must be a letter (apart from the doller sign – which is reserved for system variables and runtime subprogram names. The restriction of variable names to a maximum of 8 characters is a consequence of the IBM origin of the Language.

Variables are (by default) of types denoted by the initial letter and the convention is that integer variables have names beginning with any letter from I to N and real variables begin with A – H and O – Z. To complicate matters slightly, a variable may explicitly be assigned to a different type by declaration at the beginning of a program or subroutine. Thus START is a real variable and ISTART is an integer variable by default, but by means of an explicit declaration statement:

Integer Start             Real Input

as described, the program will treat variable START as an integer and INPUT as a real. Double precision and logical are declared in the same way.


Page 11 of 63