C sinh()

sinh() 函数在 math.h 头文件中定义。它有助于返回给定数字的双曲正弦值(以弧度为单位)。


double sinh( double x ); #where x should be in double

此外,还使用了两个函数 sinhf() 和 sinhl(),分别用于浮点型和长双精度型。


float sinhf(float x); 
long double sinhl(long double x); 

sinh() 参数

sinh() 函数接受一个参数。使用强制转换运算符,我们可以将类型显式转换为 double,以查找 int、float 或 long double 类型的双曲正弦。

参数 描述 必需/可选
双精度浮点数值 任何从负到正的 double 值 必需

sinh() 返回值

sinh() 函数的返回值为 double 类型,以弧度为单位。

输入 返回值
从负数到正数的任意值 以弧度表示的双精度值

sinh() 示例

示例 1:C 语言中 sinh() 函数的工作原理?


#include <stdio.h>
#include <math.h>
#define PI 3.141592654
int main()
{
    double ang = 2.50, output;
    output = sinh(ang);
    printf("The Sine hyperbolic of %.2lf (in radians) is %.2lf", ang, output);
    return 0;
}

输出


The Sine hyperbolic of 2.50 (in radians) is 6.05

示例 2:C 语言中 sinh() 如何工作?


#include <stdio.h>
#include <math.h>
int main (){
 double v, output;
   v = 0.5;

   output = sinh(v);
   printf("The hyperbolic sine of %lf is %lf degrees", v, output);
   
   return(0);
}

输出


The hyperbolic sine of 0.500000 is 0.521095 degrees