cos, cosh (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference

Calculate the cosine (cos) or hyperbolic cosine (cosh).

double cos(    double x 
);double cosh(    double x 
);

Parameters

  • x
    Angle in radians.

Return Values

The cos and cosh functions return the cosine and hyperbolic cosine, respectively, of x.

If x is greater than or equal to 263, or less than or equal to –263, a loss of significance in the result of a call to cos occurs, in which case the function generates a _TLOSS error and returns an indefinite (same as a quiet NaN).

If the result is too large in a cosh call, the function returns HUGE_VAL.

Example

/* SINCOS.C: This program displays the sine, hyperbolic
 * sine, cosine, and hyperbolic cosine of pi / 2.
 */


void main( void )
{
   double pi = 3.1415926535;
   double x, y;

   x = pi / 2;
   y = sin( x );
   printf( "sin( %f ) = %f\n", x, y );
   y = sinh( x );
   printf( "sinh( %f ) = %f\n",x, y );
   y = cos( x );
   printf( "cos( %f ) = %f\n", x, y );
   y = cosh( x );
   printf( "cosh( %f ) = %f\n",x, y );
}

Output

sin( 1.570796 ) = 1.000000
sinh( 1.570796 ) = 2.301299
cos( 1.570796 ) = 0.000000
cosh( 1.570796 ) = 2.509178

Requirements

OS Versions: Windows CE 2.0 and later.
Header: stdlib.h.
Link Library: coredll.dll.

See Also

acos | asin | atan | sin | tan

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.