共用方式為


acosh、acoshf、acoshl

計算反雙曲餘弦。

double acosh(    double x  ); float acosh(    float x  );  // C++ only long double acosh(    long double x );  // C++ only float acoshf(    float x  ); long double acoshl(    long double x );

參數

  • x
    浮點值。

傳回值

acosh 函式會傳回 x 的反雙曲餘弦 (Arc 雙曲餘弦)。 這些函式在網域 x ≥ 1 中有效。 若 x 小於 1,errno 會設為 EDOM,且結果為無訊息 NaN。 若 x 為無訊息 NaN、不確定或無限大,則會傳回相同的值。

輸入

SEH 例外狀況

_matherr 例外狀況

± QNAN、IND、INF

x < 1

備註

當您使用 C++ 時,可以呼叫採用並傳回 float 或 long double 值的 acosh 的多載。 在 C 程式中,acosh 會一律採用並傳回 double。

需求

函式

C 標頭

C++ 標頭

acosh, acoshf, acoshl

<math.h>

<cmath>

如需其他相容性資訊,請參閱 相容性

範例

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

.NET Framework 對等用法

不適用。若要呼叫標準 C 函式,請使用 PInvoke。如需詳細資訊,請參閱平台叫用範例

請參閱

參考

浮點支援

長雙精度

cos、cosf、cosl、cosh、coshf、coshl

sin、sinf、sinl、sinh、sinhf、sinhl

asinh、asinhf、asinhl

tan、tanf、tanl、tanh、tanhf、tanhl

atanh、atanhf、atanhl

_CItan