C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
C++ Math tanh()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': float tanh(float x); double tanh(double x); long double tanh(long double x); double tanh(integral 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. #include 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. #include 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
|