tan, tanh (Windows CE 5.0)

Send Feedback

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

Calculate the tangent (tan) or hyperbolic tangent (tanh).

double tan( doublex );double tanh( doublex);

Parameters

  • x
    Angle in radians.

Return Values

tan returns the tangent 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 occurs, in which case the function generates a _TLOSS error and returns an indefinite (same as a quiet NaN).

You can modify error handling with _matherr.

tanh returns the hyperbolic tangent of x. There is no error return.

Example

Description

This program displays the tangent of pi / 4 and the hyperbolic tangent of the result.

Code

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

   x = tan( pi / 4 );
   y = tanh( x );
   printf( "tan( %f ) = %f\n", pi/4, x );
   printf( "tanh( %f ) = %f\n", x, y );
}
// Output
tan( 0.785398 ) = 1.000000
tanh( 1.000000 ) = 0.761594

Requirements

OS Versions: Windows CE 2.0 and later.

Header: string.h.

Link Library: coredll.dll.

See Also

acos | asin | atan | cos | sin

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.