当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


PHP atanh()用法及代码示例


atan() 函数是预定义的 PHP 函数,用于求解三角函数。它返回一个数的反双曲正切值。

用法:

atanh(number);
参数 描述 必需/可选
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






相关用法


注:本文由纯净天空筛选整理自 PHP atanh() Function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。