For both large and small numbers some form of exponential notation is useful, both to make long numbers
more readable, and to make execution possible in extreme cases. In addition, exponential notation is used
whenever the “simple” form would give misleading information.
For example:
numeric digits 5
say 54321*54321
would display
2950800000
in long form. This is clearly misleading, and so the result is expressed as
2.9508E+9
instead.
The definition of numbers is, therefore, extended as:
blanks
sign
blanks
digits
digits
.
digits
.
digits
digits
.
E
digits
sign
blanks
The integer following the
E
represents a power of ten that is to be applied to the number. The
E
can be in
uppercase or lowercase.
Certain character strings are numbers even though they do not appear to be numeric to the user.
Specifically, because of the format of numbers in exponential notation, strings, such as
0E123
(0 raised to
the 123 power) and
1E342
(1 raised to the 342 power), are numeric. In addition, a comparison such as
0E123=0E567
gives a true result of
1
(0 is equal to 0). To prevent problems when comparing nonnumeric
strings, use the strict comparison operators.
Here are some examples:
12E7
=
120000000
/* Displays "1" */
12E-5
=
0.00012
/* Displays "1" */
-12e4
=
-120000
/* Displays "1" */
0e123
=
0e456
/* Displays "1" */
0e123
==
0e456
/* Displays "0" */
The preceding numbers are valid for input data at all times. The results of calculations are returned in
either conventional or exponential form, depending on the setting of NUMERIC DIGITS. If the number of
places needed before the decimal point exceeds DIGITS, or the number of places after the point exceeds
twice DIGITS, exponential form is used. The exponential form REXX generates always has a sign
following the
E
to improve readability. If the exponent is
0
, then the exponential part is omitted—that is, an
exponential part of
E+0
is never generated.
You can explicitly convert numbers to exponential form, or force them to be displayed in long form, by
using the FORMAT built-in function (see page 185).
Scientific notation
is a form of exponential notation that adjusts the power of ten so a single nonzero digit
appears to the left of the decimal point.
Engineering notation
is a form of exponential notation in which
from one to three digits (but not simply
0
) appear before the decimal point, and the power of ten is always
expressed as a multiple of three. The integer part may, therefore, range from
1
through
999
. You can
control whether Scientific or Engineering notation is used with the instruction:
NUMERIC FORM
SCIENTIFIC
ENGINEERING
expression
VALUE
;
Scientific notation is the default.
Numbers and Arithmetic
Chapter 16. Numbers and Arithmetic
223
Содержание SC34-5764-01
Страница 1: ...CICS Transaction Server for VSE ESA REXX Guide SC34 5764 01...
Страница 2: ......
Страница 3: ...CICS Transaction Server for VSE ESA REXX Guide SC34 5764 01...
Страница 22: ...xx CICS TS for VSE ESA REXX Guide...
Страница 23: ...Part 1 User s Guide Copyright IBM Corp 1992 2009 1...
Страница 24: ...2 CICS TS for VSE ESA REXX Guide...
Страница 40: ...18 CICS TS for VSE ESA REXX Guide...
Страница 54: ...Using Variables and Expressions 32 CICS TS for VSE ESA REXX Guide...
Страница 106: ...84 CICS TS for VSE ESA REXX Guide...
Страница 110: ...88 CICS TS for VSE ESA REXX Guide...
Страница 122: ...100 CICS TS for VSE ESA REXX Guide...
Страница 123: ...Part 2 Reference Copyright IBM Corp 1992 2009 101...
Страница 124: ...102 CICS TS for VSE ESA REXX Guide...
Страница 130: ...Introduction 108 CICS TS for VSE ESA REXX Guide...
Страница 152: ...REXX General Concepts 130 CICS TS for VSE ESA REXX Guide...
Страница 224: ...Functions 202 CICS TS for VSE ESA REXX Guide...
Страница 252: ...230 CICS TS for VSE ESA REXX Guide...
Страница 278: ...256 CICS TS for VSE ESA REXX Guide...
Страница 312: ...DB2 Interface 290 CICS TS for VSE ESA REXX Guide...
Страница 316: ...High level Client Server Support 294 CICS TS for VSE ESA REXX Guide...
Страница 340: ...318 CICS TS for VSE ESA REXX Guide...
Страница 344: ...for execs Commands 322 CICS TS for VSE ESA REXX Guide...
Страница 399: ...Part 3 Appendixes Copyright IBM Corp 1992 2009 377...
Страница 400: ...378 CICS TS for VSE ESA REXX Guide...
Страница 438: ...416 CICS TS for VSE ESA REXX Guide...
Страница 442: ...System Definition Customization Administration 420 CICS TS for VSE ESA REXX Guide...
Страница 446: ...Security 424 CICS TS for VSE ESA REXX Guide...
Страница 448: ...426 CICS TS for VSE ESA REXX Guide...
Страница 464: ...442 CICS TS for VSE ESA REXX Guide...
Страница 466: ...444 CICS TS for VSE ESA REXX Guide...
Страница 468: ...446 CICS TS for VSE ESA REXX Guide...
Страница 476: ...454 CICS TS for VSE ESA REXX Guide...
Страница 478: ...456 CICS TS for VSE ESA REXX Guide...
Страница 479: ......
Страница 480: ...SC34 5764 01...
Страница 481: ...Spine information CICS TS for VSE ESA REXX Guide...