C++ Standard Library C++ STL Library

C++ <cmath> - sinh() Function



The C++ <cmath> sinh() function returns hyperbolic sine of a value. The hyperbolic sine of x is defined as:

sinh

where e is an Euler's number.

Syntax

double sinh (double x);
float sinh (float x);
long double sinh (long double x);
double sinh (double x);
float sinh (float x);
long double sinh (long double x);
//additional overloads for integral types
double sinh (T x);           

Parameters

x Specify the value.

Return Value

Returns the hyperbolic sine of a value.

Example:

In the example below, sinh() function is used to find out the hyperbolic sine of a value.

#include <iostream>
#include <cmath>
using namespace std;
 
int main (){
  cout<<sinh(0)<<"\n";
  cout<<sinh(2)<<"\n";
  cout<<sinh(4)<<"\n";
  return 0;
}

The output of the above code will be:

0
3.62686
27.2899

❮ C++ <cmath> Library

5