共用方式為


atanh、atanhf、atanhl

計算反雙曲正切。

double atanh(    double x  ); float atanh(    float x  );  // C++ only long double atanh(    long double x );  // C++ only float atanhf(    float x  ); long double atanhl(    long double x );

參數

  • x
    浮點值。

傳回值

atanh 函式會傳回 x 的反雙曲正切 (Arc 雙曲正切)。 若 x 大於 1,或小於 –1,errno 會設為 EDOM,且結果為無訊息 NaN。 若 x 等於 1 或 -1,則會分別傳回無限大的正數或負數,且 errno 會設為 ERANGE。

輸入

SEH 例外狀況

Matherr 例外狀況

± QNAN、IND

X ≥ 1; x ≤ -1

備註

因為 C++ 允許多載,所以您可以呼叫採用並傳回 float 或 long double 值的 atanh 的多載。 在 C 程式中,atanh 會一律採用並傳回 double。

需求

函式

C 標頭

C++ 標頭

atanh, atanhf, atanhl

<math.h>

<cmath>

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

範例

// crt_atanh.c
// This program displays the hyperbolic tangent of pi / 4
// and the arc hyperbolic tangent of the result.
//

#include <math.h>
#include <stdio.h>

int main( void )
{
   double pi = 3.1415926535;
   double x, y;

   x = tanh( pi / 4 );
   y = atanh( x );
   printf( "tanh( %f ) = %f\n", pi/4, x );
   printf( "atanh( %f ) = %f\n", x, y );
}
  

.NET Framework 對等用法

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

請參閱

參考

浮點支援

長雙精度

acos、acosf、acosl

asin、asinf、asinl

atan、atanf、atanl、atan2、atan2f、atan2l

cos、cosf、cosl、cosh、coshf、coshl

sin、sinf、sinl、sinh、sinhf、sinhl

tan、tanf、tanl、tanh、tanhf、tanhl

_CItan