This function evaluates the cosine for the argument in degrees.
COSDG — Function value. (Output)
X — Argument in degrees for which the cosine is desired. (Input)
Generic: COSDG (X)
Specific: The specific interface names are S_COSDG and D_COSDG.
Single: COSDG (X)
Double: The double precision function name is DCOSDG.
To avoid unduly inaccurate results, the magnitude of x must not be so large that the integer part fills more than the computer word. Under no circumstances is the magnitude of x allowed to be larger than the largest representable integer because complete loss of accuracy occurs in this case.
In this example, cos 100° computed and printed.
USE COSDG_INT
USE UMACH_INT
IMPLICIT NONE
! Declare variables
INTEGER NOUT
REAL VALUE, X
! Compute
X = 100.0
VALUE = COSDG(X)
! Print the results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) X, VALUE
99999 FORMAT (' COS(', F6.2, ' deg) = ', F6.3)
END
COS(100.00 deg) = -0.174
PHONE: 713.784.3131 FAX:713.781.9260 |