title | ms.date | api_name | api_location | api_type | topic_type | f1_keywords | helpviewer_keywords | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sinh, sinhf, sinhl |
04/10/2018 |
|
|
|
|
|
|
Calculates the hyperbolic sine.
double sinh(double x);
float sinhf(float x);
long double sinhl(long double x);
float sinh(float x); // C++ only
long double sinh(long double x); // C++ only
x
Angle in radians.
The sinh functions return the hyperbolic sine of x. By default, if the result is too large, sinh sets errno to ERANGE and returns ±HUGE_VAL.
Input | SEH Exception | Matherr Exception |
---|---|---|
± QNAN,IND | None | _DOMAIN |
|x| ≥ 7.104760e+002 | OVERFLOW+INEXACT | OVERFLOW |
For more information about return codes, see errno, _doserrno, _sys_errlist, and _sys_nerr.
Because C++ allows overloading, you can call overloads of sinh that take and return float or long double values. In a C program, sinh always takes and returns double.
Routine | Required header (C) | Required header (C++) |
---|---|---|
sinh, sinhf, sinhl | <math.h> | <cmath> or <math.h> |
For additional compatibility information, see Compatibility.
// 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
Floating-Point Support
acosh, acoshf, acoshl
asinh, asinhf, asinhl
atanh, atanhf, atanhl
cosh, coshf, coshl
tanh, tanhf, tanhl