C asinh()

asinh() 函数定义在 math.h 头文件中。它有助于返回给定数字的反双曲正弦值(以弧度表示)。反双曲正弦值是指反双曲正弦函数的值。


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

此外,asinhf() 和 asinhl() 函数分别用于 float 类型和 long double 类型。


float asinhf(float x); 
long double asinhl(long double x); 

asinh() 参数

asinh() 函数接受一个参数,其范围为负值到正值之间的任意值。使用类型转换运算符,我们可以将 int、float 或 long double 类型显式转换为 double 类型,以找到其反双曲正弦值。

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

asinh() 返回值

asinh() 函数的返回值为 double 类型,以弧度表示。

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

asinh() 示例

示例 1:C 语言中 asinh() 函数的工作方式?


#include <stdio.h>
#include <math.h>
#define PI 3.141592654
int main()
{
 float n = 8.0;
 double output;
 output = asinh(n);
 
 printf("The Inverse of sinh(%.2f) = %.2f in radians", n, output);
 //radians to degree  Convertion
 output=(output*180)/PI;
 printf("\nThe Inverse of sinh(%.2f) = %.2f in degrees", n, output);
 return 0;

输出


The Inverse of sinh(8.00)=2.78 in radians
The Inverse of sinh(8.00)=159.08 in degrees

示例 2:C 语言中 asinh() 的工作原理?


#include <stdio.h>
#include <math.h>
int main (){
  printf("%lf\n", asinh(0));
  printf("%lf\n", asinh(2));
  printf("%lf\n", asinh(4));
  return 0;
}

输出


0.000000
1.443635
2.094713