PHP Function Reference

PHP atanh() Function



The PHP atanh() function returns inverse hyperbolic tangent of a value. The inverse hyperbolic tangent of x is defined as:

atanh

In special cases it returns the following:

  • If the argument is NAN or its absolute value is greater than 1, then the result is NAN.
  • If the argument is 1, then the result is positive infinity.
  • If the argument is -1, then the result is negative infinity.

Syntax

atanh(number)

Parameters

number Required. Specify the value.

Return Value

Returns the inverse hyperbolic tangent of a value.

Example:

In the example below, atanh() function is used to find out the inverse hyperbolic tangent of a value.

<?php
echo "atanh(-0.5) = ".atanh(-0.5)."\n";
echo "atanh(0) = ".atanh(0)."\n";
echo "atanh(0.5) = ".atanh(0.5)."\n";
echo "atanh(-1) = ".atanh(-1)."\n";
echo "atanh(1) = ".atanh(1)."\n";
echo "atanh(-2) = ".atanh(-2)."\n";
echo "atanh(2) = ".atanh(2)."\n";
echo "atanh(NAN) = ".atanh(NAN)."\n";
?>

The output of the above code will be:

atanh(-0.5) = -0.54930614433405
atanh(0) = 0
atanh(0.5) = 0.54930614433405
atanh(-1) = -INF
atanh(1) = INF
atanh(-2) = NAN
atanh(2) = NAN
atanh(NAN) = NAN

❮ PHP Math Reference