C++ Math tanh()Last Updated : 17 Mar 2025 The function computes the hyperbolic tangent of an angle given in radian. Mathematically, tanhx = ex -e-x/ ex+e-x SyntaxSuppose the angle is 'x': Parameterx: The value whose hyperbolic tangent is to be computed. Return valueIt returns the hyperbolic tangent of x. Example 1Let's see the simple example when the value of x is integer type. Output: Value of degree is : 60 tanh(x) : 0.780507 In this example, tanh(x) function computes the hyperbolic tangent of x and returns the value 0.78. Example 2Let's see the simple example when the value of x is float type. Output: Value of degree is : 45.2 tanh(x) : 0.657552 In this example, tanh(x) function computes the hyperbolic tangent of x and returns the value 0.65. Next TopicC++ Math Functions |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India