VMS Help  —  RTL Routines, OTS$  OTS$DIV_PK_LONG
    The Packed Decimal Division with Long Divisor routine divides
    fixed-point decimal data, which is stored in packed decimal form,
    when precision and scale requirements for the quotient call for
    multiple precision division. The divisor must have a precision of
    30 or 31 digits.

    Format

      OTS$DIV_PK_LONG  packed-decimal-dividend

                       ,packed-decimal-divisor ,divisor-precision

                       ,packed-decimal-quotient ,quotient-precision

                       ,precision-data ,scale-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 that contains the precision of the divisor. The 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
    the packed decimal string into which OTS$DIV_PK_LONG 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. The
    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_LONG 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)

 scale-data

    OpenVMS usage:word_signed
    type:         word (signed)
    access:       read only
    mechanism:    by value

    Scale factor of the decimal point. The scale-data argument is a
    signed word that contains the scale data.

    OTS$DIV_PK_LONG defines the scale-data argument as follows:

    scale-data = 31 - prec(packed-decimal-divisor)
Close Help