Compiler Library/XL Reference Manual (32650-90029)
4-: 12
---------------------------------------------------------------------------------------------
| | |
| Source Digit Count | Target "Words" |
| | |
---------------------------------------------------------------------------------------------
| | |
| 1 to 4 | 1 |
| | |
---------------------------------------------------------------------------------------------
| | |
| 5 to 9 | 2 |
| | |
---------------------------------------------------------------------------------------------
| | |
| 10 to 18 | 4 |
| | |
---------------------------------------------------------------------------------------------
| | |
| 19 to 28 | 6 |
| | |
---------------------------------------------------------------------------------------------
If the source digit count is zero, no conversion is performed.
Possible Traps
Invalid packed-decimal digit (3)
Invalid decimal operand length (5)
Special Conventions of HPPACLONGDIVD
HPPACLONGDIVD includes the following conventions for compatibility with
the MPE V E procedure, LONGDIVD.
* Operand lengths are not validated. Results are undefined if
operand1
is longer than 28 digits, or if
operand2
is longer than 36 digits.
* When
operand2
is longer than 28 digits, only the first 28 digits (and
the sign) are passed by the caller. The remaining digits are assumed
to be zeros, and no space needs to be allocated for them by the
caller. In effect, HPPACLONGDIVD will supply the necessary zeros by
multiplying its local copy of
operand2
by the appropriate power of
ten.
* When using HPPACLONGDIVD, the caller is responsible for ensuring that
the quotient does not exceed 28 digits. If it does, results are
undefined.
Possible Traps
Invalid packed-decimal digit (3)
Invalid decimal operand length (5)left arrow
For HPPACDIVD only
Decimal divide-by-zero (6)
Special Conventions of HPPACLONGDIVD
HPPACLONGDIVD includes the following conventions for compatibility with
the MPE V E procedure, LONGDIVD.
* Operand lengths are not validated. Results are undefined if
operand1
is longer than 28 digits, or if
operand2
is longer than 36 digits.
* When
operand2
is longer than 28 digits, only the first 28 digits (and
the sign) are passed by the caller. The remaining digits are assumed
to be zeros, and no space needs to be allocated for them by the
caller. In effect, HPPACLONGDIVD will supply the necessary zeros by
multiplying its local copy of
operand2
by the appropriate power of
ten.
* When using HPPACLONGDIVD, the caller is responsible for ensuring that