PHP tanh() Function
In this chapter you will learn:
- Definition for PHP tanh() Function
- Syntax for PHP tanh() Function
- Parameter for PHP tanh() Function
- Return for PHP tanh() Function
- Example - Return the hyperbolic tangent of different numbers
Definition
The tanh()
function returns the hyperbolic tangent of a number,
which is equal to sinh(x)/cosh(x).
Syntax
PHP tanh() Function has the following syntax.
tanh(number);
Parameter
Parameter | Is Required | Description |
---|---|---|
number | Required. | Specifies a number |
Return
Return | Description |
---|---|
Return Value | The hyperbolic tangent of number |
Return Type | Float |
Example
Return the hyperbolic tangent of different numbers:
<?php/*from j a v a 2s . c o m*/
echo(tanh(M_PI_4) . "\n");
echo(tanh(0.5) . "\n");
echo(tanh(-0.5) . "\n");
echo(tanh(5) . "\n");
echo(tanh(1) . "\n");
echo(tanh(-1) . "\n");
echo(tanh(-10));
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP mysqli_affected_rows() Function
- Syntax for PHP mysqli_affected_rows() Function
- Parameter for PHP mysqli_affected_rows() Function
- Return for PHP mysqli_affected_rows() Function
- Example - prints out affected rows from different queries
Home » PHP Tutorial » PHP Math Functions