
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
tanh Function in PHP
The tanh() function returns the hyperbolic tangent of the specified value.
Syntax
tanh(val)
Parameters
val − A value in radians
Return
The tanh() function returns the hyperbolic tangent of the specified value val.
Example
The following is an example to get the hyperbolic tangent of 0 and 1:
<?php echo(tanh(0) . "<br>"); echo(tanh(1) . "<br>"); ?>
Output
0<br>0.76159415595576<br>
Example
Let us see an example to get the hyperbolic tangent of constant M_PI_4 −
<?php echo(tanh(M_PI_4)); ?>
Output
0.65579420263267
Example
Let us see an example to get the hyperbolic tangent of values 0.50 and -0.50 −
<?php echo(tanh(0.50) . "<br>"); echo(tanh(-0.50)); ?>
Output
0.46211715726001<br>-0.46211715726001
Example
Let us see another example to get the hyperbolic tangent of negative values −
<?php echo(tanh(-5) . "<br>"); echo(tanh(-10)); ?>
Output
-0.9999092042626<br>-0.99999999587769
Advertisements