逆ハイパーボリック コサインを計算します。
構文
double acosh( double x );
float acoshf( float x );
long double acoshl( long double x );
#define acosh(X) // Requires C11 or later
float acosh( float x ); // C++ only
long double acosh( long double x ); // C++ only
パラメーター
x
浮動小数点値。
戻り値
acosh関数は、xの逆双曲線余弦 (アーク双曲線余弦) を返します。 これらの関数はドメイン x ≥ 1 で有効です。 xが 1 未満の場合、errnoは EDOM に設定され、結果は静かな NaN になります。 x が簡易な NaN、不定値、または無限大の場合は、同じ値が返されます。
| 入力 | SEH 例外 | _matherr 例外 |
|---|---|---|
| ± QNaN、IND、INF | なし | なし |
x< 1 |
なし | なし |
解説
C++ を使用する場合、 acosh または float の値を受け取って返す long double のオーバーロードを呼び出すことができます。 C プログラムでは、 <tgmath.h> マクロを使用してこの関数を呼び出さない限り、 acosh は常に doubleを受け取って返します。
<tgmath.h>acosh() マクロを使用する場合は、引数の型によって、この関数のどのバージョンが選択されるかが決定されます。 詳細については、「ジェネリック型数値演算」を参照してください。
既定では、この関数のグローバル状態の適用対象は、アプリケーションになります。 この動作を変更するには、「CRT でのグローバル状態」を参照してください。
要件
| 機能 | C ヘッダー | C++ ヘッダー |
|---|---|---|
acosh、 acoshf、 acoshl |
<math.h> | <cmath> |
acosh マクロ |
<tgmath.h> |
互換性の詳細については、「 Compatibility」を参照してください。
例
// crt_acosh.c
// Compile by using: cl /W4 crt_acosh.c
// This program displays the hyperbolic cosine of pi / 4
// and the arc hyperbolic cosine of the result.
#include <math.h>
#include <stdio.h>
int main( void )
{
double pi = 3.1415926535;
double x, y;
x = cosh( pi / 4 );
y = acosh( x );
printf( "cosh( %f ) = %f\n", pi/4, x );
printf( "acosh( %f ) = %f\n", x, y );
}
cosh( 0.785398 ) = 1.324609
acosh( 1.324609 ) = 0.785398
関連項目
数値演算と浮動小数点のサポート
asinh、 asinhf、 asinhl
atanh、 atanhf、 atanhl
cosh、 coshf、 coshl
sinh、 sinhf、 sinhl
tanh、 tanhf、 tanhl