sinh, sinhf, sinhl

计算双曲正弦值。

语法

double sinh(double x);
float sinhf(float x);
long double sinhl(long double x);
#define sinh(x) // Requires C11 or higher

float sinh(float x);  // C++ only
long double sinh(long double x);  // C++ only

参数

x
角度(以弧度为单位)。

返回值

sinh 函数返回 x 的双曲正弦值。 默认情况下,如果结果太大,sinherrno 设置为 ERANGE 并返回 ± HUGE_VAL

输入 SEH 异常 _matherr 异常
± QNaN、IND _DOMAIN
|x| ≥ 7.104760e+002 OVERFLOW+INEXACT OVERFLOW

有关返回代码的详细信息,请参阅 errno_doserrno_sys_errlist_sys_nerr

备注

由于 C++ 允许重载,因此你可以调用采用并返回 sinhfloat 值的 long double 重载。 在 C 程序中,除非你使用 <tgmath.h> 宏来调用此函数,否则 sinh 始终接受并返回 double

如果使用 <tgmath.h> 中的 sinh 宏,参数的类型将确定选择哪个版本的函数。 有关详细信息,请参阅泛型类型数学

默认情况下,此函数的全局状态范围限定为应用程序。 若要更改此行为,请参阅 CRT 中的全局状态

要求

例程 必需的标头 (C) 必需的标头 (C++)
sinh, sinhf, sinhl <math.h> <cmath><math.h>
sinh <tgmath.h>

有关兼容性的详细信息,请参阅 兼容性

示例

// crt_sinhcosh.c
// This program displays the hyperbolic
// sine and hyperbolic cosine of pi / 2.
// Compile by using: cl /W4 crt_sinhcosh.c

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

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

   x = pi / 2;
   y = sinh( x );
   printf( "sinh( %f ) = %f\n",x, y );
   y = cosh( x );
   printf( "cosh( %f ) = %f\n",x, y );
}
sinh( 1.570796 ) = 2.301299
cosh( 1.570796 ) = 2.509178

另请参阅

数学和浮点支持
acoshacoshfacoshl
asinhasinhfasinhl
atanhatanhfatanhl
coshcoshfcoshl
tanhtanhftanhl