/* after the instruction */
Numeric form scientific
123.45 * 1e11
->
1.2345E+13
/* after the instruction */
Numeric form engineering
123.45
* 1e11
->
12.345E+12
Numeric Information
To determine the current settings of the NUMERIC options, use the built-in functions DIGITS, FORM, and
FUZZ. These functions return the current settings of NUMERIC DIGITS, NUMERIC FORM, and NUMERIC
FUZZ, respectively.
Whole Numbers
Within the set of numbers REXX understands, it is useful to distinguish the subset defined as
whole
numbers
. A whole number in REXX is a number that has a decimal part that is all zeros (or that has no
decimal part). In addition, it must be possible to express its integer part simply as digits within the
precision set by the NUMERIC DIGITS instruction. REXX would express larger numbers in exponential
notation, after rounding, and, therefore, these could no longer be safely described or used as whole
numbers.
Numbers Used Directly by REXX
As discussed, the result of any arithmetic operation is rounded (if necessary) according to the setting of
NUMERIC DIGITS. Similarly, when REXX directly uses a number (which has not necessarily been
involved in an arithmetic operation), the same rounding is also applied. It is just as though the number had
been added to 0.
In the following cases, the number used must be a whole number, and the largest number you can use is
999999999.
v
The positional patterns in parsing templates (including variable positional patterns)
v
The power value (right hand operand) of the power operator
v
The values of
exprr
and
exprf
in the DO instruction
v
The values given for DIGITS or FUZZ in the NUMERIC instruction
v
Any number used in the numeric option in the TRACE instruction.
Errors
Two types of errors may occur during arithmetic:
v
Overflow or Underflow
This error occurs if the exponential part of a result would exceed the range that the language processor
can handle, when the result is formatted according to the current settings of NUMERIC DIGITS and
NUMERIC FORM. The language defines a minimum capability for the exponential part, namely the
largest number that can be expressed as an exact integer in default precision. Because the default
precision is
9
, VM supports exponents in the range
-999999999
through
999999999
.
Because this allows for (very) large exponents, overflow or underflow is treated as a syntax error.
v
Insufficient storage
Storage is needed for calculations and intermediate results, and on occasion an arithmetic operation
may fail because of lack of storage. This is considered a terminating error as usual, rather than an
arithmetic error.
Numbers and Arithmetic
224
CICS TS for VSE/ESA: REXX Guide
Summary of Contents for SC34-5764-01
Page 1: ...CICS Transaction Server for VSE ESA REXX Guide SC34 5764 01...
Page 2: ......
Page 3: ...CICS Transaction Server for VSE ESA REXX Guide SC34 5764 01...
Page 22: ...xx CICS TS for VSE ESA REXX Guide...
Page 23: ...Part 1 User s Guide Copyright IBM Corp 1992 2009 1...
Page 24: ...2 CICS TS for VSE ESA REXX Guide...
Page 40: ...18 CICS TS for VSE ESA REXX Guide...
Page 54: ...Using Variables and Expressions 32 CICS TS for VSE ESA REXX Guide...
Page 106: ...84 CICS TS for VSE ESA REXX Guide...
Page 110: ...88 CICS TS for VSE ESA REXX Guide...
Page 122: ...100 CICS TS for VSE ESA REXX Guide...
Page 123: ...Part 2 Reference Copyright IBM Corp 1992 2009 101...
Page 124: ...102 CICS TS for VSE ESA REXX Guide...
Page 130: ...Introduction 108 CICS TS for VSE ESA REXX Guide...
Page 152: ...REXX General Concepts 130 CICS TS for VSE ESA REXX Guide...
Page 224: ...Functions 202 CICS TS for VSE ESA REXX Guide...
Page 252: ...230 CICS TS for VSE ESA REXX Guide...
Page 278: ...256 CICS TS for VSE ESA REXX Guide...
Page 312: ...DB2 Interface 290 CICS TS for VSE ESA REXX Guide...
Page 316: ...High level Client Server Support 294 CICS TS for VSE ESA REXX Guide...
Page 340: ...318 CICS TS for VSE ESA REXX Guide...
Page 344: ...for execs Commands 322 CICS TS for VSE ESA REXX Guide...
Page 399: ...Part 3 Appendixes Copyright IBM Corp 1992 2009 377...
Page 400: ...378 CICS TS for VSE ESA REXX Guide...
Page 438: ...416 CICS TS for VSE ESA REXX Guide...
Page 442: ...System Definition Customization Administration 420 CICS TS for VSE ESA REXX Guide...
Page 446: ...Security 424 CICS TS for VSE ESA REXX Guide...
Page 448: ...426 CICS TS for VSE ESA REXX Guide...
Page 464: ...442 CICS TS for VSE ESA REXX Guide...
Page 466: ...444 CICS TS for VSE ESA REXX Guide...
Page 468: ...446 CICS TS for VSE ESA REXX Guide...
Page 476: ...454 CICS TS for VSE ESA REXX Guide...
Page 478: ...456 CICS TS for VSE ESA REXX Guide...
Page 479: ......
Page 480: ...SC34 5764 01...
Page 481: ...Spine information CICS TS for VSE ESA REXX Guide...