Using Expressions; Arithmetic Operators - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

Using Expressions

Using Expressions

An expression is something that needs to be calculated and consists of numbers,
variables, or strings, and one or more operators. The operators determine the kind
of calculation to be done on the numbers, variables, and strings. There are four
types of operators: arithmetic, comparison, logical, and concatenation.

Arithmetic Operators

Arithmetic operators work on valid numeric constants or on variables that represent
valid numeric constants.
Types of Numeric Constants
12
12.5
1.25E2
-12
The arithmetic operators you can use are as follows:
Operator
+
-
*
/
%
//
**
-number
+number
28
z/OS V1R1.0 TSO/E REXX User's Guide
A whole number has no decimal point or commas. Results of
arithmetic operations with whole numbers can contain a maximum
of nine digits unless you override the default with the NUMERIC
DIGITS instruction. For information about the NUMERIC DIGITS
instruction, see z/OS TSO/E REXX Reference. Examples of whole
numbers are: 123456789 0 91221 999
A decimal number includes a decimal point. Results of arithmetic
operations with decimal numbers are limited to a total maximum of
nine digits (NUMERIC DIGITS default) before and after the
decimal. Examples of decimal numbers are: 123456.789
0.888888888
A floating point number in exponential notation, is sometimes
called scientific notation. The number after the "E" represents the
number of places the decimal point moves. Thus 1.25E2 (also
written as 1.25E+2) moves the decimal point to the right two places
and results in 125. When an "E" is followed by a minus (-), the
decimal point moves to the left. For example, 1.25E-2 is .0125.
Floating point numbers are used to represent very large or very
small numbers. For more information about floating point numbers,
see z/OS TSO/E REXX Reference.
A signed number with a minus (-) next to the number represents a
negative value. A plus next to a number indicates that the number
should be processed as it is written. When a number has no sign, it
is processed as a positive value.
Meaning
Add
Subtract
Multiply
Divide
Divide and return a whole number without a remainder
Divide and return the remainder only
Raise a number to a whole number power
Negate the number
Add the number to 0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents