The Packed Decimal Division with Short Divisor routine divides fixed-point decimal data when precision and scale requirements for the quotient call for multiple-precision division. Format OTS$DIV_PK_SHORT packed-decimal-dividend ,packed-decimal-divisor ,divisor-precision ,packed-decimal-quotient ,quotient-precision ,precision-data
1 – Returns
OpenVMS usage:cond_value type: longword (unsigned) access: write only mechanism: by value
2 – Arguments
packed-decimal-dividend OpenVMS usage:varying_arg type: packed decimal string access: read only mechanism: by reference Dividend. The packed-decimal-dividend argument is the address of a packed decimal string that contains the shifted dividend. Before being passed as input, the packed-decimal-dividend argument is always multiplied by 10**c, where c is defined as follows: c = 31 - prec(packed-decimal-dividend) Multiplying packed-decimal-dividend by 10**c makes packed- decimal-dividend a 31-digit number. packed-decimal-divisor OpenVMS usage:varying_arg type: packed decimal string access: read only mechanism: by reference Divisor. The packed-decimal-divisor argument is the address of a packed decimal string that contains the divisor. divisor-precision OpenVMS usage:word_signed type: word (signed) access: read only mechanism: by value Precision of the divisor. The divisor-precision argument is a signed word integer that contains the precision of the divisor; high-order bits are filled with zeros. packed-decimal-quotient OpenVMS usage:varying_arg type: packed decimal string access: write only mechanism: by reference Quotient. The packed-decimal-quotient argument is the address of a packed decimal string into which OTS$DIV_PK_SHORT writes the quotient. quotient-precision OpenVMS usage:word_signed type: word (signed) access: read only mechanism: by value Precision of the quotient. The quotient-precision argument is a signed word that contains the precision of the quotient; high- order bits are filled with zeros. precision-data OpenVMS usage:word_signed type: word (signed) access: read only mechanism: by value Additional digits of precision required. The precision-data argument is a signed word that contains the value of the additional digits of precision required. OTS$DIV_PK_SHORT computes the precision-data argument as follows: precision-data = scale(packed-decimal-quotient) + scale(packed-decimal-divisor) - scale(packed-decimal-dividend) - 31 + prec(packed-decimal-dividend)