標準/拡張機能 | C/C++ | 依存項目 |
---|---|---|
ISO C |
両方 |
#include <math.h>
double cosh(double x);
float cosh(float x); /* C++ only */
long double cosh(long double x); /* C++ only */
float coshf(float x);
long double coshl(long double x);
結果がオーバーフローする場合、関数は +HUGE_VAL を 戻し、errno に ERANGE を設定します。
⁄* CELEBC27
This example calculates y to be the hyperbolic cosine of x.
*⁄
#include <math.h>
#include <stdio.h>
int main(void)
{
double x,y;
x = 7.2;
y = cosh(x);
printf("cosh( %lf ) = %lf¥n", x, y);
}
cosh( 7.200000 ) = 669.715755