***EXPR-introduction
INTRODUCTION
------------
EXPR stands for "expression".  Expressions are required in
about one half of the F statements.  For example, the
PRINT statement has an optional expression list:

    PRINT * [, EXPR-list]

Another example is the DO statement, which can have either
zero, two or three expressions:

    DO [ EXPR, EXPR [, EXPR]]

***EXPR-definition
DEFINITION
----------
For starters, an expression can be defined as a
combination of one or more of the following
 o  NAMEs                [for example: current_total]
 o  numbers              [examples: 15 and 0.01]
 o  character strings    [for example: "Enter a name: "]
 o  logical constants    [there are two: .true., .false.]
 o  function references  [for example: Ave(1.3, 2.4, 5.8)]
 o  parentheses          [for example: ((a)+(b)+(c))/(3)]
 o  operators
     Here are all the operators:
      +      (addition)
      -      (subtraction)
      *      (multiplication)
      /      (division)
      **     (exponentiation)
      //     (concatenation)
      ==     (equal)
      /=     (not equal)
      >      (greater than)
      >=     (greater than or equal)
      <      (less than)
      <=     (less than or equal)
      .not.  (logical not)
      .and.  (logical and)
      .or.   (logical or)
      .eqv.  (logical equivalent)
      .neqv. (logical not equivalent)

***EXPR-examples
EXAMPLES
--------
Here are some examples of F expressions.  Expressions
must appear in a statement.  The below examples of
expressions are in PRINT statements.  Each of these
expressions could appear in a number of other statements
such as an assignment statement on the right of the
equals ('=').

   print *, "hello F world!"
   print *, expr_first, ExprSecond(arg1, arg2), 3
   print *, 1
   print *, (1), curr_total+new_number >= MAX_VALUE
   print *, 1.1+2.2
   print *, 1+(2*3.0) / 4
   print *, (input_name == names(i)) .or. (i>start_point)
   print *, .not. person(i)%dead .and. person(i)%wealthy
   print *, "more examples" //" are "// "found elsewhere"

***EXPR-parentheses
PARENTHESES
-----------
If you decide not to use parentheses, the result of your
expression may not be what you anticipated.  For example,
the result of the expression

           1+2*3

is 7.  The result is not 9 because 2*3 happens first as
in the expression

           1+(2*3)

If you wanted the result of 9, you could have written

           (1+2)*3

The fact that * happens before + is described by stating
"* has higher precedence than +".  There is a table of
operator precedence found elsewhere under the EXPR menu.

***EXPR-table of results
TABLE OF RESULTS
----------------
There are unary and binary operations.  The three unary
operators are .not., + and -.  These are unary because
they operate on one operand.  The rest of the operators
are binary which means that they have two operands instead
of one.  (Note that + and - are binary operators as well
as unary operators.)

Unary operators are placed before their operand, so the
operand is known as "Right".  Binary operators are placed
in between their operands, so the operands are known as
"Left" and "Right".

The below example of the + operator has a real value on
the left and an integer value on the right, resulting in
printing the real value 1.5.

   print *, 0.5 + 1

The below table shows the results of all the operations.
In this table,
  I  stands for INTEGER
  R  stands for REAL
  Z  stands for COMPLEX
  C  stands for CHARACTER
  L  stands for LOGICAL
Here are the results of all legal operations:

                Operands
 Operator      Left Right   Result
 --------      ---- ----    ------
 Unary                I      I
  +, -                R      R
                      Z      Z

 Binary          I    I      I
  +, -,          I    R      R
  *, /,          I    Z      Z
  **             R    I      R
                 R    R      R
                 R    Z      Z
                 Z    I      Z
                 Z    R      Z
                 Z    Z      Z

 Binary //       C    C      C

 Binary          I    I      L
  ==, /=         I    R      L
                 I    Z      L
                 R    I      L
                 R    R      L
                 R    Z      L
                 Z    I      L
                 Z    R      L
                 Z    Z      L
                 C    C      L

 Binary          I    I      L
  >, >=          I    R      L
  <, <=          R    I      L
                 R    R      L
                 C    C      L

 Unary .not.          L      L

 Binary          L    L      L
  .and.
  .or.
  .eqv.
  .neqv.

***EXPR-table of precedence
TABLE OF PRECEDENCE
-------------------
The following table shows operator precedence.

  Category         Operators          Precedence
  --------   ----------------------   ----------
  extension       unary .NAME.          highest
  numeric             **                  :     
  numeric           * or /                :
  numeric          unary + or -           :
  numeric         binary + or -           :
  character          //                   :
  relational   ==, /=, >, >=, <, <=       :
  logical           .not.                 :
  logical           .and.                 :
  logical            .or.                 :
  logical        .eqv. or .neqv.          :
  extension       binary .NAME.         lowest
***END
