C++ sinh()

yash.ladekar's avatar
Published Oct 8, 2022Updated Jun 20, 2023
Contribute to Docs

The sinh() function returns the hyperbolic sine of an argument given in radians.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn C++ — a versatile programming language that’s important for developing software, games, databases, and more.
    • Beginner Friendly.
      11 hours

Syntax

sinh(angle)

The angle parameter should be expressed in radians. To convert from degrees to radians:

radians = degrees * PI / 180

Example

The following example uses sinh() to return the hyperbolic sine of 0.0 in radians:

#include <iostream>
#include <cmath>
int main() {
double x = 0.0;
double result;
result = std::sinh(x);
std::cout << "The hyperbolic sine of " << x << " radians is " << result << "\n";
// Output: The hyperbolic sine of 0 radians is 0
}

Codebyte Example

The following code example returns the hyperbolic sine of a given number using the sinh function.

Code
Output
Loading...

All contributors

Contribute to Docs

Learn C++ on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn C++ — a versatile programming language that’s important for developing software, games, databases, and more.
    • Beginner Friendly.
      11 hours