Real Expressions

<real expression>

──┬─────┬─ <real primary> ─┬────────────────────────────────┬──────────┤
  ├─ + ─┤                  │ ┌◄───────────────────────────┐ │
  └─ ─ ─┘                  └─┴─┬─ + ───┬─ <real primary> ─┴─┘
                               ├─ ─ ───┤
                               ├─ * ───┤
                               ├─ DIV ─┤
                               └─ MOD ─┘

Explanation

The plus sign (+) operator gives the sum of the real primaries; the minus sign (–) operator gives their difference; the asterisk (*) operator gives their product. The slash (/) operator gives a quotient that preserves the fractional part; the DIV operator gives a quotient with the fractional part truncated. The MOD operator gives the remainder after the first real primary has been divided by the second.

The order of evaluation (highest first) for arithmetic operations is as follows:

  • Real primary

  • Prefix + or –

  • *, /, DIV, or MOD

  • Infix + or –

First, all real primaries are evaluated; second, the prefix + or – (if any) is applied to the real primary that it precedes. Finally, the remaining operations are performed in decreasing order of priority. If two operations are of the same priority, the left operation is performed first. When a real expression is enclosed in parentheses, it becomes a real primary.