sinh(), sinhf(), sinhl() — Calculate hyperbolic sine

Standards

Standards / Extensions C or C++ Dependencies

ISO C
POSIX.1
XPG4
XPG4.2
ISO/ANSI C++
C99
Single UNIX Specification, Version 3
C++ TR1 C99

both  

Format

#include <math.h>

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

General description

Calculates the hyperbolic sine of x, with x expressed in radians.
Note: These functions work in both IEEE Binary Floating-Point and hexadecimal floating-point formats. See IEEE binary floating-point for more information about IEEE Binary Floating-Point.

Returned value

If successful, the function returns the calculated value.

Otherwise, if the result is too large, the function sets errno to ERANGE and returns ±HUGE_VAL, depending on the value of x. If the value underflows, the function returns 0 and sets errno to ERANGE.

Special behavior for IEEE:If successful, the function returns the hyperbolic sine of x with x expressed in radians.

If the result would overflow, the function returns ±HUGE_VAL, according to the value of x, and sets errno to ERANGE. No other errors can occur.

Example

CELEBS28
⁄* CELEBS28                                      

   This example computes y as the hyperbolic sine of &pi.&slr.2.                
                                                                                
 *⁄                                                                             
#include <math.h>                                                               
#include <stdio.h>                                                              
                                                                                
int main(void)                                                                  
{                                                                               
   double pi, x, y;                                                             
                                                                                
   pi = 3.1415926535;                                                           
   x = pi⁄2;                                                                    
   y = sinh(x);                                                                 
                                                                                
   printf("sinh( %lf ) = %lf\n", x, y);                                         
}                                                                               
Output
sinh( 1.570796 ) = 2.301299

Related information