HP 3000 Manuals

ACOS Function [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation


HP COBOL II/XL Reference Manual

ACOS Function 

The ACOS function returns the arccosine of the parameter.  The function
type is numeric.

Syntax 

     FUNCTION ACOS (parameter-1)

Parameters 

parameter-1           Must be class numeric and must be between -1 and 1,
                      inclusive.

Return Value 

The value returned is the approximation of the arccosine of parameter-1 
and is between 0 and pi, inclusive.  The return value is a numeric value
in radians.

Example 

     77  COS-OF-ANGLE       PIC S9V9(5)  VALUE +0.70711.
     77  ANGLE-RADIANS      PIC S99V9(5) VALUE ZERO.
             :
     COMPUTE ANGLE-RADIANS = FUNCTION ACOS (COS-OF-ANGLE).
     DISPLAY COS-OF-ANGLE.
     DISPLAY ANGLE-RADIANS.

The above example displays the following:

     +0.70711
     +00.78539



MPE/iX 5.0 Documentation