C Tutorial/math.h/tanh

Материал из C\C++ эксперт
Перейти к: навигация, поиск

tanh

Item Value Header file math.h Declaration float tanhf(float arg);double tanh(double arg);long double tanhl(long double arg); Return returns the hyperbolic tangent of arg.


<source lang="cpp">#include <math.h>

 #include <stdio.h>
 int main(void)
 {
   double val = -1.0;
   do {
     printf("Hyperbolic tangent of %f is %f.\n", val, tanh(val));
     val += 0.1;
   } while(val<=1.0);
   return 0;
 }</source>