sin, sinf, sinl, sinh, sinhf, sinhl
사인과 하이퍼볼릭 사인을 계산합니다.
double sin(
double x
);
float sin(
float x
); // C++ only
long double sin(
long double x
); // C++ only
float sinf(
float x
);
long double sinl(
long double x
);
double sinh(
double x
);
float sinh(
float x
); // C++ only
long double sinh(
long double x
); // C++ only
float sinhf(
float x
);
long double sinhl(
long double x
);
매개 변수
- x
라디안에서 단위의 각도입니다.
반환 값
sin 함수는 x 의 사인 값을 반환합니다. x 가 263와 같거나 클 경우 또는 –263와 같거나 작을 경우, 결과에 중요한 손실 발생합니다.
sinh 함수는 x 의 쌍곡선 사인을 반환합니다. 기본적으로 결과가 너무 큰 경우 sinh 는 errno 을 ERANGE 으로 설정하고 ±HUGE_VAL을 반환합니다.
입력 |
SEH 예외 |
Matherr 예외 |
---|---|---|
± QNAN,IND |
없음 |
_DOMAIN |
± ∞ (sin, sinf, sinl) |
잘못된 |
_DOMAIN |
|x| ≥ 7.104760e+002 (sinh, sinhf, sinhl) |
OVERFLOW+INEXACT |
오버플로가 발생했습니다. |
반환 코드에 대한 자세한 내용은 errno, _doserrno, _sys_errlist 및 _sys_nerr를 참조하십시오.
설명
C++가 오버로딩을 허용하기 때문에 float 혹은 long double 값을 사용하고 반환하는 sin 과 sinh 의 오버로드를 호출할 수 있습니다. C 프로그램에서 sin 및 sinh는 항상 double을 사용하고 반환합니다.
요구 사항
루틴 |
필수 헤더 |
---|---|
sin, sinf, sinl, sinh, sinhf, sinhl |
<math.h> |
호환성에 대한 자세한 내용은 호환성을 참조하십시오.
예제
// crt_sincos.c
// This program displays the sine, hyperbolic
// sine, cosine, and hyperbolic cosine of pi / 2.
//
#include <math.h>
#include <stdio.h>
int 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 );
}
해당 .NET Framework 항목
참고 항목
참조
atan, atanf, atanl, atan2, atan2f, atan2l
cos, cosf, cosl, cosh, coshf, coshl