cos
- Date:
09-08-2011
NAME
COS, DCOS, QCOS, CCOS, CDCOS, CQCOS, cos, cosf, cosl, cosq, ccosf, ccos, ccosl, ccosq - Cosine function
SYNOPSIS
C Synopsis
#include <math.h>
float cosf(float);
double cos(double);
long double cosl(long double);
#include <quadmath.h>
__float128 cosq(__float128);
#include <complex.h>
float complex ccosf(float complex);
double complex ccos(double complex);
long double complex ccosl(long double complex);
#include <complex.h>
#include <quadmath.h>
__float128 complex ccosq(__float128 complex);
Fortran Synopsis
COS ([X=]x)
DCOS ([X=]x)
QCOS ([X=]x)
CCOS ([X=]x)
CDCOS ([X=]x)
CQCOS ([X=]x)
COSD ([X=]x) (Deferred implementation)
DCOSD ([X=]x) (Deferred implementation)
QCOSD ([X=]x) (Deferred implementation)
Cray Extensions
cosq, ccosq, QCOS, CDCOS, CQCOS, COSD, DCOSD, QCOSD
IMPLEMENTATION
Cray Linux Environment (CLE)
DESCRIPTION
Return the cosine of x.
Fortran
These are elemental intrinsic functions. The Fortran COS and COSD functions are generic; they accept real or complex arguments of any size. The others are specific. See the RETURN VALUES section for more information on input data types and return values.
For COS, DCOS,QCOS, CCOS, and CDCOS, the argument must be in radians. It is treated as (modulo 2 * pi).
For COSD, DCOSD, and QCOSD, the argument must be in degrees and is treated as modulo 360.
C
The C functions accept double, floating point, or complex arguments types as specified in the synopsis. Arguments must be in radians.
NOTES
The COS, DCOS, QCOS, CCOS intrinsic function names can be passed as arguments; the others cannot.
COS(x) yields NaN if |x| is infinite or NaN.
Fortran (kind=16) quad-precision is always 128 bits. Double precision may also be 128 bits if -ep -sdefault64 or -ep -sreal64 is specified on the command line.
Cray Fortran and C compilers optimize cosine for 32 and 64 bit arguments.
RETURN VALUES
COS returns the same precision cosine as its argument.
DCOS returns the double-precision cosine of its double-precision argument.
QCOS returns the quad-precision cosine of its quad-precision argument.
CCOS returns the complex single-precision cosine of its complex single-precision argument.
CDCOS returns the complex double-precision cosine of its complex double-precision argument.
CQCOS returns the complex quad-precision cosine of its complex quad-precision argument.
SEE ALSO
cos(3)