PHP atanh() 函数
atanh() 函数是预定义的 PHP 函数,用于解决三角函数问题。它返回一个数的反双曲正切值。
语法
atanh(number);
Parameter | Description | Required/Optional |
---|---|---|
number | Specify a number | Required |
示例1
<?php
num=(M_PI_4);
echo "Your passing number (M_PI_4) is: ".num;
echo "<br>"."By using 'atanh()' function your number is :".(atanh($num));
?>
输出:
Your passing number (M_PI_4) is: 0.78539816339745
By using 'atanh()' function your number is :1.0593061708232
示例2
<?php
num=(0.50);
echo "Your passing number is: ".num;
echo "<br>"."By using 'atanh()' function your number is :".(atanh($num));
?>
输出:
Your passing number is: 0.5
By using 'atanh()' function your number is :0.54930614433405
示例3
<?php
num=(-0.50);
echo "passing negative value: ".num;
echo "<br>"."By using 'atanh()' function your number is :".(atanh($num));
?>
输出:
passing negative value: -0.5
By using 'atanh()' function your number is :-0.54930614433405
示例4
<?php
num=1;
echo "passing positive value: ".num;
echo "<br>"."By using 'atanh()' function your number is :".(atanh($num));
?>
输出:
passing negative value: 1
By using 'atanh()' function your number is :INF
示例5
<?php
num=(-1);
echo "passing negative value: ".num;
echo "<br>"."By using 'atanh()' function your number is :".(atanh($num));
?>
输出:
passing negative value: -1