當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。