首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::sinh

Defined in header <cmath>

float sinh( float arg );

(1)

double sinh( double arg );

(2)

long double sinh( long double arg );

(3)

double sinh( Integral arg );

(4)

(since C++11)

计算双曲正弦arg...

4%29一组过载或接受任意参数的函数模板积分型等于2%29%28double29%。

参数

arg

-

value of a floating-point or Integral type

返回值

如果没有错误发生,则双曲正弦arg%28 sinh%28 arg%29,或

耳-e-Arg

*。

%29被返回。

如果溢出导致范围错误,±HUGE_VAL,,,±HUGE_VALF,或±HUGE_VALL会被归还。

如果由于下流而发生范围错误,则返回舍入%29后的正确结果%28。

错误处理

错误按数学[医]错误处理...

如果实现支持ieee浮点算法%28IEC 60559%29,

  • 如果参数为±0或±∞,则不加修改地返回参数。
  • 如果参数为nan,则返回nan。

注记

POSIX指定如果是地下水流,arg返回,如果不支持,则实现定义值不大于dbl。[医]敏·弗利特[医]和LDBL[医]民回来了。

二次

代码语言:javascript
复制
#include <iostream>
#include <cmath>
#include <cerrno>
#include <cstring>
#include <cfenv>
 
#pragma STDC FENV_ACCESS ON
int main()
{
    std::cout << "sinh(1) = " << std::sinh(1) << '\n'
              << "sinh(-1) = " << std::sinh(-1) << '\n'
              << "log(sinh(1)+cosh(1)) = "
              << std::log(std::sinh(1)+std::cosh(1)) << '\n';
    // special values
    std::cout << "sinh(+0) = " << std::sinh(0.0) << '\n'
              << "sinh(-0) = " << std::sinh(-0.0) << '\n';
    // error handling 
    errno=0; std::feclearexcept(FE_ALL_EXCEPT);
    std::cout << "sinh(710.5) = " << std::sinh(710.5) << '\n';
    if(errno == ERANGE)
        std::cout << "    errno == ERANGE: " << std::strerror(errno) << '\n';
    if(std::fetestexcept(FE_OVERFLOW))
        std::cout << "    FE_OVERFLOW raised\n";
}

二次

产出:

二次

代码语言:javascript
复制
sinh(1) = 1.1752
sinh(-1) = -1.1752
log(sinh(1)+cosh(1)) = 1
sinh(+0) = 0
sinh(-0) = -0
sinh(710.5) = inf
    errno == ERANGE: Numerical result out of range
    FE_OVERFLOW raised

二次

另见

cosh

computes hyperbolic cosine (ch(x)) (function)

tanh

hyperbolic tangent (function)

asinh (C++11)

computes the inverse hyperbolic sine (arsinh(x)) (function)

sinh(std::complex)

computes hyperbolic sine of a complex number (sh(z)) (function template)

sinh(std::valarray)

applies the function std::sinh to each element of valarray (function template)

C.新华的文件

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券