C# Atanh()

Priyanshjain10's avatar
Published Nov 19, 2025
Contribute to Docs

The Math.Atanh() method returns the inverse hyperbolic tangent (hyperbolic arctangent) of a specified number. The inverse hyperbolic tangent is the value whose hyperbolic tangent is the input number.

  • 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 Microsoft's popular C# programming language, used to make websites, mobile apps, video games, VR, and more.
    • Beginner Friendly.
      15 hours

Syntax

Math.Atanh(value);

Parameters:

  • value: A double-precision floating-point number in the range -1 to 1, representing the hyperbolic tangent value.

Return value:

The Math.Atanh() method returns the inverse hyperbolic tangent of the given value as a double.

It returns:

  • NaN (Not a Number) if the value is less than -1 or greater than 1.
  • NegativeInfinity if the value is exactly -1.
  • PositiveInfinity if the value is exactly 1.

Example: Basic Usage of Math.Atanh()

The following example demonstrates the basic usage of Math.Atanh():

using System;
class Program
{
static void Main()
{
double value = 0.5;
double result = Math.Atanh(value);
Console.WriteLine($"Atanh({value}) = {result}");
}
}

This will output:

Atanh(0.5) = 0.5493061443340548

Codebyte Example

In this example, different values are passed to Math.Atanh() to observe how the result changes:

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 Microsoft's popular C# programming language, used to make websites, mobile apps, video games, VR, and more.
    • Beginner Friendly.
      15 hours