Intel fortran-80 Laptop User Manual


 
FORTRAN-80
FORTRAN
Concepts
2.2.4 Expressions and Operators
An
expression
is
a combination
of
numbers, symbols,
and
operators.
It
may
include
parentheses
and
may also include functions (discussed in
Chapter
5). Expressions
appear
in assignment statements (e.g., A = B + C) as controls in certain
data
pro-
cessing statements (e.g., IF
FLAG
.NE.
3
GO
TO
250),
and
in subroutine calls
(CALLSUB(X+l,
Y).
FORTRAN
has four kinds
of
2.2.4.1 Character Expressions. A
character
expression consists
of
either a
character
constant,
a character variable reference,
or
a character
array
element
reference. The expression
may
be enclosed in parentheses.
2.2.4.2 Arithmetic Expressions.
An
arithmetic expression performs a numeric
computation.
This
computation
is
limited by the range
and
precision
of
numeric
values representable in the processor (see section
F.l).
If
any
part
of
the computa-
tion produces values outside this range, the results are undefined.
Arithmetic operands must identify values
of
type integer
or
real.
2.2.4.2.1 Arithmetic
Operators.
The
arithmetic
operators
are:
Operator
**
/
*
+
Meaning
Exponentiation
Division
Multiplication
U
nary
or
binary addition
Unary
or
binary subtraction
The following expressions calculate the perimeter,
area,
and
diagonal length
of
a
square with side
length'S.'
SPERIM =
4*S
SQAREA =
S**2
SQDIAG = SQRT (2*(S* *2))
2-7