cosh()、coshf()、coshl() - 双曲線余弦の計算

標準

標準/拡張機能 C/C++ 依存項目

ISO C
POSIX.1
XPG4
XPG4.2
ISO/ANSI C++
C99
Single UNIX Specification、バージョン 3
C++ TR1 C99

両方  

形式

#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);

機能説明

x の双曲線余弦を計算します。x の値は、ラジアンで表示されます。
注: これらの関数は、IEEE 2 進数浮動小数点形式と 16 進浮動小数点形式の両方で機能します。 IEEE 2 進数浮動小数点の詳細は、IEEE 2 進数浮動小数点を参照してください。

戻り値

結果がオーバーフローする場合、関数は +HUGE_VAL を 戻し、errno に ERANGE を設定します。

CELEBC27
⁄* 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

関連情報