Syntax
tanh(number)
Description
The tanh() function returns the hyperbolic tangent of argument.
Example
printf("HYPERBOLIC TANGENT TEST\n\n") printf(" x tan(x) definition\n") printf(" ----- -------- ----------\n") i = -2.1 while ((i += 0.1) <= 2.0) { eplusx = exp(i) eminusx = exp (-i) printf(" %+5.2f %+8.5f %+8.5f\n",i,tanh(i),(eplusx - eminusx) / (eplusx + eminusx)) } HYPERBOLIC TANGENT TEST x tan(x) definition ----- -------- ---------- -2.00 -0.96403 -0.96403 -1.90 -0.95624 -0.95624 -1.80 -0.94681 -0.94681 -1.70 -0.93541 -0.93541 -1.60 -0.92167 -0.92167 -1.50 -0.90515 -0.90515 -1.40 -0.88535 -0.88535 -1.30 -0.86172 -0.86172 -1.20 -0.83365 -0.83365 -1.10 -0.80050 -0.80050 -1.00 -0.76159 -0.76159 -0.90 -0.71630 -0.71630 -0.80 -0.66404 -0.66404 -0.70 -0.60437 -0.60437 -0.60 -0.53705 -0.53705