?
? ????? PHP ??? ???? ??? ?? ??
在頭文件<math.h>中定義 | ||
---|---|---|
float atanhf( float arg ); | (1) | (since C99) |
double atanh( double arg ); | (2) | (since C99) |
long double atanhl( long double arg ); | (3) | (since C99) |
Defined in header <tgmath.h> | ||
#define atanh( arg ) | (4) | (since C99) |
1-3)計(jì)算的反雙曲正切值arg
。
4)類型 - 通用宏:如果參數(shù)具有類型long double
,atanhl
則被調(diào)用。否則,如果參數(shù)具有整數(shù)類型或類型double
,atanh
則調(diào)用該參數(shù)。否則,atanhf
被調(diào)用。如果參數(shù)是復(fù)雜的,則宏調(diào)用相應(yīng)的復(fù)變函數(shù)(catanhf
,catanh
,catanhl
)。
arg | - | 浮點(diǎn)值代表雙曲線區(qū)域的面積 |
---|
如果沒有錯(cuò)誤發(fā)生,則arg
(tanh-1)的反雙曲正切值
(arg)或artanh(arg))。
如果發(fā)生域錯(cuò)誤,則返回實(shí)現(xiàn)定義的值(NaN,如果支持)。
如果發(fā)生極錯(cuò)誤±HUGE_VAL
,±HUGE_VALF
或±HUGE_VALL
返回(用正確的符號(hào))。
如果由于下溢而發(fā)生范圍錯(cuò)誤,則返回正確的結(jié)果(舍入后)。
按照math_errhandling中的指定報(bào)告錯(cuò)誤。
如果參數(shù)不在區(qū)間-1,+1上,則會(huì)發(fā)生范圍錯(cuò)誤。
如果參數(shù)為±1,則會(huì)發(fā)生極點(diǎn)錯(cuò)誤。
如果實(shí)現(xiàn)支持IEEE浮點(diǎn)運(yùn)算(IEC 60559),
如果參數(shù)為±0,則不加修改地返回
如果參數(shù)為±1,則返回并FE_DIVBYZERO
提高±∞ 。
如果| arg |> 1,則NaN返回并FE_INVALID
升高。
如果參數(shù)是NaN,則返回NaN
盡管C標(biāo)準(zhǔn)將該函數(shù)命名為“雙曲正切”,但雙曲函數(shù)的反函數(shù)是區(qū)域函數(shù)。他們的論點(diǎn)是雙曲線領(lǐng)域,而不是弧線。正確的名稱是“反雙曲正切”(由POSIX使用)或“區(qū)域雙曲線正切”。
POSIX指定在發(fā)生下溢時(shí),arg
未經(jīng)修改就返回,如果不支持,則返回不大于DBL_MIN,F(xiàn)LT_MIN和LDBL_MIN的實(shí)現(xiàn)定義值。
#include <stdio.h>#include <math.h>#include <float.h>#include <errno.h>#include <fenv.h>#pragma STDC FENV_ACCESS ON int main(void){ printf("atanh(0) = %f\natanh(-0) = %f\n", atanh(0), atanh(-0.0)); printf("atanh(0.9) = %f\n", atanh(0.9)); //error handling errno = 0; feclearexcept(FE_ALL_EXCEPT); printf("atanh(-1) = %f\n", atanh(-1)); if(errno == ERANGE) perror(" errno == ERANGE"); if(fetestexcept(FE_DIVBYZERO)) puts(" FE_DIVBYZERO raised");}
可能的輸出:
atanh(0) = 0.000000atanh(-0) = -0.000000atanh(0.9) = 1.472219atanh(-1) = -inf errno == ERANGE: Numerical result out of range FE_DIVBYZERO raised
C11標(biāo)準(zhǔn)(ISO / IEC 9899:2011):
7.12.5.3 atanh函數(shù)(p:241)
7.25類型通用數(shù)學(xué)<tgmath.h>(p:373-375)
F.10.2.3 atanh函數(shù)(p:520)
C99標(biāo)準(zhǔn)(ISO / IEC 9899:1999):
7.12.5.3 atanh函數(shù)(p:221-222)
7.22類型通用數(shù)學(xué)<tgmath.h>(p:335-337)
F.9.2.3 atanh函數(shù)(p:457)