IBM SC34-5764-01 Uživatelský manuál Strana 239

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 481
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 238
Chapter 16. Numbers and Arithmetic
REXX defines the usual arithmetic operations (addition, subtraction, multiplication, and division) in as
natural a way as possible. What this really means is that the rules followed are those that are
conventionally taught in schools and colleges.
During the design of these facilities, however, it was found that unfortunately the rules vary considerably
(indeed much more than generally appreciated) from person to person and from application to application
and in ways that are not always predictable. The arithmetic described here is, therefore, a compromise
that (although not the simplest) should provide acceptable results in most applications.
Introduction
Numbers (that is, character strings used as input to REXX arithmetic operations and built-in functions) can
be expressed very flexibly. Leading and trailing blanks are permitted, and exponential notation can be
used. Some valid numbers are:
12 /* a whole number */
'-76' /* a signed whole number */
12.76 /* decimal places */
' + 0.003 ' /* blanks around the sign and so forth */
17. /* same as "17" */
.5 /* same as "0.5" */
4E9 /* exponential notation */
0.73e-7 /* exponential notation */
In exponential notation, a number includes an exponent, a power of ten by which the number is multiplied
before use. The exponent indicates how the decimal point is shifted. Thus, in the preceding examples, 4E9
is simply a short way of writing 4000000000, and 0.73e-7 is short for 0.000000073.
The arithmetic operators include addition (+), subtraction (-), multiplication (*), power (**), division (/),
prefix plus (+), and prefix minus (-). In addition, there are two further division operators: integer divide (%)
divides and returns the integer part; remainder (//) divides and returns the remainder.
The result of an arithmetic operation is formatted as a character string according to definite rules. The
most important of these rules are as follows (see the “Definition” section for full details):
v Results are calculated up to some maximum number of significant digits (the default is 9, but you can
alter this with the NUMERIC DIGITS instruction to give whatever accuracy you need). Thus, if a result
requires more than 9 digits, it would usually be rounded to 9 digits. For example, the division of 2 by 3
would result in 0.666666667 (it would require an infinite number of digits for perfect accuracy).
v Except for division and power, trailing zeros are preserved (this is in contrast to most popular
calculators, which remove all trailing zeros in the decimal part of results). So, for example:
2.40 + 2 -> 4.40
2.40 - 2 -> 0.40
2.40 * 2 -> 4.80
2.40 / 2 -> 1.2
This behavior is desirable for most calculations (especially financial calculations).
If necessary, you can remove trailing zeros with the STRIP function (see page 192), or by division by 1.
v A zero result is always expressed as the single digit 0.
v Exponential form is used for a result depending on its value and the setting of NUMERIC DIGITS (the
default is 9). If the number of places needed before the decimal point exceeds the NUMERIC DIGITS
setting, or the number of places after the point exceeds twice the NUMERIC DIGITS setting, the
number is expressed in exponential notation:
1e6 * 1e6 -> 1E+12 /* not 1000000000000 */
1 / 3E10 -> 3.33333333E-11 /* not 0.0000000000333333333 */
© Copyright IBM Corp. 1992, 2009 217
Zobrazit stránku 238
1 2 ... 234 235 236 237 238 239 240 241 242 243 244 ... 480 481

Komentáře k této Příručce

Žádné komentáře

LG V-4030T Handbücher

Bedienungsanleitungen und Benutzerhandbücher für Staubsauger LG V-4030T.
Wir stellen 1 PDF-Handbücher LG V-4030T zum kostenlosen herunterladen nach Dokumenttypen zur Verfügung Bedienungsanleitung






Weitere Produkte und Handbücher für Staubsauger LG

Modelle Dokumententyp
V-4200HTV Bedienungsanleitung   LG V-4200HTV Owner's manual [en] , 6 Seiten
V-CP243NBN Bedienungsanleitung   LG V-CP243NBN Owner's manual [et] , 6 Seiten
V-C5865CT Bedienungsanleitung   LG V-C5865CT Owner's manual [en] , 6 Seiten
V-KC403HT Bedienungsanleitung   LG V-KC403HT Owner's manual, 14 Seiten
V-C4560HTV Bedienungsanleitung   LG V-C4560HTV Owner's manual, 6 Seiten
V-5000HT Bedienungsanleitung   LG V-5000T Owner’s Manual, 7 Seiten
V-CP243RDB Bedienungsanleitung   LG V-CP243RDB Owner's manual, 14 Seiten
V-2600TE Bedienungsanleitung   LG V-2600TE Owner’s Manual, 12 Seiten
V-3546HTV Bedienungsanleitung   LG V-3546HTV Owner's manual [fr] , 6 Seiten
V-C2940NB Bedienungsanleitung   LG V-C2940NB Owner’s Manual, 6 Seiten
V-C4360HEV Bedienungsanleitung   LG V-C4360HEV Owner's manual, 6 Seiten
VT3310 Bedienungsanleitung   LG VT3310 Owner’s Manual, 14 Seiten
V-CQ952ST Bedienungsanleitung   LG V-CQ952ST Owner’s Manual, 12 Seiten
VTC3742ND Bedienungsanleitung   LG VTC3742ND Owner's manual, 12 Seiten
V-CP953ND Bedienungsanleitung   LG V-CP953ND Owner's manual, 7 Seiten
V-C7760HTU Bedienungsanleitung   LG V-C7760HTU Owner's manual [en] , 33 Seiten
V-CA261ND Bedienungsanleitung   LG V-CA261ND Owner's manual, 21 Seiten
V-4350HTV Bedienungsanleitung   LG V-4350HTV Owner's manual, 6 Seiten
VTC3031NB Bedienungsanleitung   LG VTC3031NB Owner's manual, 6 Seiten
V-C3443NDV Bedienungsanleitung   LG V-C3443NDV Owner's manual, 6 Seiten