다음을 통해 공유


tan, tanf, tanl, tanh, tanhf, tanhl

탄젠트(tan, tanf, 또는 tanl), 또는 쌍곡선 탄젠트를 (tanh, tanhf, 또는 tanhl)를 계산합니다.

double tan(
   double x 
);
float tan(
   float x 
);  // C++ only
long double tan(
   long double x
);  // C++ only
float tanf(
   float x 
);
long double tanl(
   long double x
);
double tanh(
   double x 
);
float tanh(
   float x 
);  // C++ only
long double tanh(
   long double x
);  // C++ only
float tanhf(
   float x 
);
long double tanhl(
   long double x
);

매개 변수

  • x
    라디안에서 단위의 각도입니다.

반환 값

tan 함수는 x 의 탄젠트 값을 반환합니다. x 가 263와 같거나 클 경우 또는 –263와 같거나 작을 경우, 결과에 중요한 손실 발생합니다.

tanh 함수는 x 의 쌍곡선 탄젠트를 반환합니다. 반환되는 오류가 없습니다.

입력

SEH 예외

Matherr 예외

± QNAN,IND

없음

_DOMAIN

± ∞ (tan, tanf)

INVALID

_DOMAIN

설명

C++가 오버로딩을 허용하기 때문에 float 혹은 long double 값을 사용하고 반환하는 tan 과 tanh 의 오버로드를 호출할 수 있습니다. C 프로그램에서 tan 및 tanh는 항상 double을 사용하고 반환합니다.

요구 사항

루틴

필수 헤더

tan, tanf, tanl, tanh, tanhf, tanhl

<math.h>

호환성에 대한 자세한 내용은 호환성을 참조하십시오.

예제

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

#include <math.h>
#include <stdio.h>

int 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 );
}
  

해당 .NET Framework 항목

참고 항목

참조

부동 소수점 지원

Long Double

acos, acosf, acosl

asin, asinf, asinl

atan, atanf, atanl, atan2, atan2f, atan2l

cos, cosf, cosl, cosh, coshf, coshl

sin, sinf, sinl, sinh, sinhf, sinhl

_CItan