cos [C++ Reference]
Keywords: c,math,cos
Date: 2009-03-19T23:39:27-0700

[[cos]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## cos

Syntax:

        #include <cmath>
        double cos( double arg );

The cos() function returns the cosine of arg, where arg is expressed in radians. The return value of cos() is in the range [-1,1]. If arg is infinite, cos() will return NAN and raise a floating-point exception.

C++ also provides the following overloaded forms:

        #include <cmath>
        float cos( float arg ); // same as cosf() in C99
        long double cos( long double arg ); // same as cosl() in C99

Related Topics: acos, asin, atan, atan2, cosh, sin, sinh, tan, tanh

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •