PHP sinh() 函数
PHP sinh() 函数是预定义的数学函数。它用于返回一个数的双曲正弦值。它等于 (exp(num) – exp(-num))/2)。
语法
float sinh ( float $arg );
Parameter | Description | Required/Optional |
---|---|---|
Number | Specify a number | Required |
示例1
<?php
n=3;
echo "Your number is:".n;
echo "<br>"."By using 'sinh()' function your value is:".(sinh($n) . "<br>");
?>
输出:
Your number is:3
By using 'sinh()' function your value is:10.01787492741
示例2
<?php
n=(-3);
echo "Your number is:".n;
echo "<br>"."By using 'sinh()' function your value is:".(sinh($n) . "<br>");
?>
输出:
Your number is:-3
By using 'sinh()' function your value is:-10.01787492741
示例3
<?php
n=0;
echo "Your number is:".n;
echo "<br>"."By using 'sinh()' function your value is:".(sinh($n) . "<br>");
?>
输出:
Your number is:0
By using 'sinh()' function your value is:0
示例4
<?php
n=M_PI;
echo "Your number is: M_PI";
echo "<br>"."By using 'sinh()' function your value is:".(sinh(n) . "<br>");
?>
输出:
Your number is: M_PI
By using 'sinh()' function your value is:11.548739357258
示例5
<?php
n=M_PI_2;
echo "Your number is: M_PI_2";
echo "<br>"."By using 'sinh()' function your value is:".(sinh(n) . "<br>");
?>
输出:
Your number is: M_PI_2
By using 'sinh()' function your value is:2.3012989023073