Returns the hyperbolic tangent of the specified double that represents an angle.
- value
- A double that represents an angle measured in radians.
A double containing the value of the hyperbolic tangent of value. If value is equal to double.NegativeInfinity, returns -1. If value is equal to double.PositiveInfinity, returns 1. If value is equal to double.NaN, returns double.NaN.
Note: Multiply by pi/180 to convert degrees to radians.
The following example demonstrates using the Math.Tanh(double) method.
C# Example
using System; public class MathTanhExample { public static void Main() { Double d1 = Math.Tanh(0); Double d2 = Math.Tanh(Math.PI); Console.WriteLine("Math.Tanh(0) returns {0}", d1); Console.WriteLine("Math.Tanh(Math.PI) returns {0}", d2); } }The output is
Math.Tanh(0) returns 0
Math.Tanh(Math.PI) returns 0.99627207622075
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0