hp.com home products and services support and drivers solutions how to buy
cd-rom home
End of Jump to page title
HP OpenVMS systems
documentation

Jump to content


HP OpenVMS RTL Library (LIB$) Manual

HP OpenVMS RTL Library (LIB$) Manual


Previous Contents Index

The address of the access name table can be obtained from the LIB$GET_ACCNAM routine. Note that file access names are valid for any protected object class.

The number of characters processed is optionally returned. This is useful in error processing. The end position will be the offset to the character that made the protection string invalid. Note that the entire protection string must be valid, or an error is returned.

Several scenarios can cause the protection string to be invalid. The format of the protection string may be invalid, or the access category abbreviations may not be valid with respect to the access name tables.


Condition Values Returned

SS$_NORMAL Routine successfully completed.
LIB$_IVARG Required parameter missing or invalid protection string.
LIB$_WRONGNUMARG Wrong number of arguments.

LIB$PAUSE

The Pause Program Execution routine suspends program execution and returns control to the calling command level.

Format

LIB$PAUSE


RETURNS


OpenVMS usage: cond_value
type: longword (unsigned)
access: write only
mechanism: by value


Arguments

None.

Description

LIB$PAUSE suspends program execution and returns control to the calling command level. The suspended image may be continued with the CONTINUE command, or it may be terminated with the EXIT or STOP command. In the latter case, the image will not return to this routine.

Note that this routine functions only for interactive jobs. If this routine is invoked in batch mode, it has no effect.


Condition Values Returned

SS$_NORMAL Routine successfully completed.
LIB$_NOCLI No CLI present. The calling process does not have a CLI or the CLI does not support the request. Note that DCL supports this function in INTERACTIVE mode only.

LIB$POLYD

The Evaluate Polynomials routine (D-floating values) allows higher-level language users to evaluate D-floating value polynomials.

D-floating values are not supported in full precision in native OpenVMS Alpha and I64 programs. They are precise to 56 bits on VAX systems, 53 or 56 bits in translated VAX images, and 53 bits in native OpenVMS Alpha and I64 programs.


Format

LIB$POLYD polynomial-argument ,degree ,coefficient ,floating-point-result


RETURNS


OpenVMS usage: cond_value
type: longword (unsigned)
access: write only
mechanism: by value


Arguments

polynomial-argument


OpenVMS usage: floating_point
type: D_floating
access: read only
mechanism: by reference

The address of a D-floating number that is the argument for the polynomial.

degree


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

The address of a signed word integer that is the highest-numbered nonzero coefficient to participate in the evaluation.

If the degree is 0, the result equals C[0]. The range of the degree is 0 to 31.

coefficient


OpenVMS usage: floating_point
type: D_floating
access: read only
mechanism: by reference, array reference

The address of an array of D-floating coefficients. The coefficient of the highest-order term of the polynomial is the lowest-addressed element in the array.

floating-point-result


OpenVMS usage: floating_point
type: D_floating
access: write only
mechanism: by reference

The address of a floating-point number that is the result of the calculation. LIB$POLYD writes the address of floating-point-result into a D-floating number.

Intermediate multiplications are carried out using extended floating-point fractions (63 bits for POLYD).


Description

LIB$POLYD provides higher-level language users with the capability of evaluating polynomials.

The evaluation is carried out by Horner's Method. The result is computed as follows:


result = C[0]+X*(C[1]+X*(C[2]+...X*(C[D])...)) 

In the above result D is the degree of the polynomial and X is the argument.

See the VAX Architecture Reference Manual for the detailed description of POLY.


Condition Values Returned

SS$_NORMAL Routine successfully completed.
SS$_FLTOVF Floating overflow.
SS$_ROPRAND Reserved operand.

Example

The C example provided in the description of LIB$INSERT_TREE also demonstrates how to use LIB$LOOKUP_TREE. Refer to that example for assistance in using this routine.

LIB$POLYF

The Evaluate Polynomials routine (F-floating values) allows higher-level language users to evaluate F-floating polynomials.

Format

LIB$POLYF polynomial-argument ,degree ,coefficient ,floating-point-result


RETURNS


OpenVMS usage: cond_value
type: longword (unsigned)
access: write only
mechanism: by value


Arguments

polynomial-argument


OpenVMS usage: floating_point
type: F_floating
access: read only
mechanism: by reference

Argument for the polynomial. The polynomial-argument argument is the address of a floating-point number that contains this argument. The polynomial-argument argument is an F-floating number.

degree


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

Highest-numbered nonzero coefficient to participate in the evaluation. The degree argument is the address of a signed word integer that contains this highest-numbered coefficient.

If the degree is 0, the result equals C[0]. The range of the degree is 0 to 31.

coefficient


OpenVMS usage: floating_point
type: F_floating
access: read only
mechanism: by reference, array reference

The address of an array of floating-point coefficients. The coefficient of the highest-order term of the polynomial is the lowest addressed element in the array. The coefficient argument is an array of F-floating numbers.

floating-point-result


OpenVMS usage: floating_point
type: F_floating
access: write only
mechanism: by reference

Result of the calculation. The floating-point-result argument is the address of a floating-point number that contains this result. LIB$POLYF writes the address of floating-point-result into an F-floating number.

Intermediate multiplications are carried out using extended floating-point fractions (31 bits for POLYF).


Description

LIB$POLYF provides higher-level language users with the capability of evaluating polynomials.

The evaluation is carried out by Horner's Method. The result is computed as follows:


result = C[0]+X*(C[1]+X*(C[2]+...X*(C[D])...)) 

In the above result D is the degree of the polynomial and X is the argument.


Condition Values Returned

SS$_NORMAL Routine successfully completed.
SS$_FLTOVF Floating overflow.
SS$_ROPRAND Reserved operand.

Examples

#1

C+ 
C This Fortran example demonstrates how to use 
C LIB$POLYF. 
C- 
 
        REAL*4 X,COEFF(5),RESULT 
        INTEGER*2 DEG 
 
C+ 
C Compute X^4 + 2*X^3 -X^2 + X - 3 using POLYF. 
C Let X = 2. 
C The coefficients needed are as follows: 
C- 
 
        DATA COEFF/1.0,2.0,-1.0,1.0,-3.0/ 
        X = 2.0 
        DEG = 4                                 ! DEG has word length. 
 
C+ 
C Calculate (2)^4 + 2*(2^3) -2^2 + 2 - 3. 
C The result should be 27. 
C- 
 
        RETURN = LIB$POLYF(X,DEG,COEFF,RESULT) 
        TYPE *,'(2)^4 + 2*(2^3) -2^2 + 2 - 3 = ',RESULT 
        END 
 
      

This Fortran example demonstrates how to call LIB$POLYF. The output generated by this program is as follows:


(2)^4 + 2*(2^3) -2^2 + 2 - 3 =    27.00000 

#2

PROGRAM POLYF(INPUT,OUTPUT); 
 
{+} 
{ This Pascal program demonstrates how to use 
{ LIB$POLYF to evaluate a polynomial. 
{-} 
 
    TYPE 
        WORD = [WORD] 0..65535; 
 
    VAR 
        COEFF  : ARRAY [0..2] OF REAL := (1.0,2.0,2.0); 
        RESULT : REAL; 
        RETURNED_STATUS : INTEGER; 
 
    [EXTERNAL] FUNCTION LIB$POLYF( 
          ARG        : REAL; 
          DEGREE     : WORD; 
          COEFF      : [REFERENCE] ARRAY [L..U:INTEGER] OF REAL; 
          VAR RESULT : REAL 
          ) : INTEGER; EXTERNAL; 
 
    [EXTERNAL] FUNCTION LIB$STOP( 
          CONDITION_STATUS : [IMMEDIATE,UNSAFE] UNSIGNED; 
          FAO_ARGS         : [IMMEDIATE,UNSAFE,LIST] UNSIGNED 
          ) : INTEGER; EXTERNAL; 
 
BEGIN 
 
{+} 
{ Call LIB$POLYF to evaluate 2(X**2) + 2*X + 1. 
{-} 
 
RETURNED_STATUS := LIB$POLYF(1.0,2,COEFF,RESULT); 
IF NOT ODD(RETURNED_STATUS) 
THEN 
    LIB$STOP(RETURNED_STATUS); 
 
WRITELN('F(1.0) = ',RESULT:5:2); 
 
END. 
 
      

This example program demonstrates how to call LIB$POLYF from Pascal. The output generated by this Pascal program is as follows:


$ RUN POLYF
F(1.0) = 5.00 


LIB$POLYG

The Evaluate Polynomials routine (G-floating values) allows higher-level language users to evaluate G-floating value polynomials.

Format

LIB$POLYG polynomial-argument ,degree ,coefficient ,floating-point-result


RETURNS


OpenVMS usage: cond_value
type: longword (unsigned)
access: write only
mechanism: by value


Arguments

polynomial-argument


OpenVMS usage: floating_point
type: G_floating
access: read only
mechanism: by reference

Argument for the polynomial. The polynomial-argument argument is the address of a floating-point number that contains this argument. The polynomial-argument argument is a G-floating number.

degree


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

Highest-numbered nonzero coefficient to participate in the evaluation. The degree argument is the address of a signed word integer that contains this highest-numbered coefficient.

If the degree is 0, the result equals C[0]. The range of the degree is 0 to 31.

coefficient


OpenVMS usage: floating_point
type: G_floating
access: read only
mechanism: by reference, array reference

Floating-point coefficients. The coefficient argument is the address of an array of floating-point coefficients. The coefficient of the highest-order term of the polynomial is the lowest addressed element in the array. The coefficient argument is an array of G-floating numbers.

floating-point-result


OpenVMS usage: floating_point
type: G_floating
access: write only
mechanism: by reference

Result of the calculation. The floating-point-result argument is the address of a floating-point number that contains this result. LIB$POLYG writes the address of floating-point-result into a G-floating number.

Intermediate multiplications are carried out using extended floating-point fractions (63 bits for POLYG).


Description

LIB$POLYG provides higher-level language users with the capability of evaluating polynomials.

The evaluation is carried out by Horner's Method. The result is computed as follows:


result = C[0]+X*(C[1]+X*(C[2]+...X*(C[D])...)) 

In the above result D is the degree of the polynomial and X is the argument.


Condition Values Returned

SS$_NORMAL Routine successfully completed.
SS$_FLTOVF Floating overflow.
SS$_ROPRAND Reserved operand.

Example

The Fortran and Pascal examples provided in the description of LIB$POLYF also demonstrate how to use LIB$POLYG. Please refer to those examples for assistance in using this routine.

LIB$POLYH

VAX Only

On OpenVMS VAX systems, the Evaluate Polynomials routine (H-floating values) allows higher-level language users to evaluate H-floating value polynomials.

This routine is not available to native OpenVMS Alpha and I64 programs but is available to translated VAX images.


Format

LIB$POLYH polynomial-argument ,degree ,coefficient ,floating-point-result


RETURNS


OpenVMS usage: cond_value
type: longword (unsigned)
access: write only
mechanism: by value


Arguments

polynomial-argument


OpenVMS usage: floating_point
type: H_floating
access: read only
mechanism: by reference

Argument for the polynomial. The polynomial-argument argument is the address of a floating-point number that contains this argument. The polynomial-argument argument is an H-floating number.

degree


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

Highest-numbered nonzero coefficient to participate in the evaluation. The degree argument is the address of a signed word integer that contains this highest-numbered coefficient.

If the degree is 0, the result equals C[0]. The range of the degree is 0 to 31.

coefficient


OpenVMS usage: floating_point
type: H_floating
access: read only
mechanism: by reference, array reference

Floating-point coefficients. The coefficient argument is the address of an array of floating-point coefficients. The coefficient of the highest-order term of the polynomial is the lowest addressed element in the array. The coefficient argument is an array of H-floating numbers.

floating-point-result


OpenVMS usage: floating_point
type: H_floating
access: write only
mechanism: by reference

Result of the calculation. The floating-point-result argument is the address of a floating-point number that contains this result. LIB$POLYH writes the address of floating-point-result into an H-floating number.

Intermediate multiplications are carried out using extended floating-point fractions (127 bits for POLYH).


Description

LIB$POLYH provides higher-level language users with the capability of evaluating polynomials.

The evaluation is carried out by Horner's Method. The result is computed as follows:


result = C[0]+X*(C[1]+X*(C[2]+...X*(C[D])...)) 

In the above result D is the degree of the polynomial and X is the argument.


Condition Values Returned

SS$_NORMAL Routine successfully completed.
SS$_FLTOVF Floating overflow.
SS$_ROPRAND Reserved operand.

Example

The C example provided in the description of LIB$INSERT_TREE also demonstrates how to use LIB$LOOKUP_TREE. Refer to that example for assistance in using this routine.

LIB$POLYS (Alpha and I64 Only)

The Evaluate Polynomials routine (IEEE S-floating values) allows higher-level language users to evaluate IEEE S-floating polynomials.

Format

LIB$POLYS polynomial-argument ,degree ,coefficient ,floating-point-result


RETURNS


OpenVMS usage: cond_value
type: longword (unsigned)
access: write only
mechanism: by value


Arguments

polynomial-argument


OpenVMS usage: floating_point
type: IEEE S_floating
access: read only
mechanism: by reference

Argument for the polynomial. The polynomial-argument argument is the address of a floating-point number that contains this argument. The polynomial-argument argument is an IEEE S-floating number.

degree


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

Highest-numbered nonzero coefficient to participate in the evaluation. The degree argument is the address of a signed word integer that contains this highest-numbered coefficient.

If the degree is 0, the result equals C[0]. The range of the degree is 0 to 31.

coefficient


OpenVMS usage: floating_point
type: IEEE S_floating
access: read only
mechanism: by reference, array reference

The address of an array of floating-point coefficients. The coefficient of the highest-order term of the polynomial is the lowest addressed element in the array. The coefficient argument is an array of IEEE S-floating numbers.

floating-point-result


OpenVMS usage: floating_point
type: IEEE S_floating
access: write only
mechanism: by reference

Result of the calculation. The floating-point-result argument is the address of a floating-point number that contains this result. LIB$POLYS writes the address of floating-point-result into an IEEE S-floating number.

Intermediate multiplications are carried out using extended floating-point fractions (31 bits for POLYS).


Description

LIB$POLYS provides higher-level language users with the capability of evaluating polynomials.

The evaluation is carried out by Horner's Method. The result is computed as follows:


result = C[0]+X*(C[1]+X*(C[2]+...X*(C[D])...)) 

In the above result, D is the degree of the polynomial and X is the argument.


Condition Values Returned

SS$_NORMAL Routine successfully completed.
SS$_FLTOVF Floating overflow.
SS$_ROPRAND Reserved operand.

Example


 
/* 
** This C example demonstrates how to use LIB$POLYS. 
*/ 
 
#if !(__IEEE_FLOAT) 
#error "Compile module with /FLOAT=IEEE_FLOAT" 
#endif 
 
#include <stdio.h> 
#include <lib$routines.h> 
 
main () 
{ 
    float x = 2.0; 
    float result = 0; 
    float coeff[5] = {1.0, 2.0, -1.0, 1.0, -3.0}; 
    short deg = 4; 
    int status; 
 
    status = lib$polys(&x, &deg, &coeff, &result); 
    if ((status & 1) != 1) lib$stop(status); 
 
    printf ("(2)^4 + 2*(2^3) -2^2 + 2 - 3 = %f (27.000000)\n", 
    result); 
} 

This C example demonstrates how to call LIB$POLYS. The output generated by this program is as follows:


(2)^4 + 2*(2^3) -2^2 + 2 - 3 = 27.000000 (27.000000) 


Previous Next Contents Index