std::tanh,std::tanhf,std::tanhl (3) - Linux Manuals
std::tanh,std::tanhf,std::tanhl: std::tanh,std::tanhf,std::tanhl
NAME
std::tanh,std::tanhf,std::tanhl - std::tanh,std::tanhf,std::tanhl
Synopsis
Defined in header <cmath>
float tanh ( float arg );
float tanhf( float arg ); (since C++11)
double tanh ( double arg ); (1) (2)
long double tanh ( long double arg );
long double tanhl( long double arg ); (3) (since C++11)
double tanh ( IntegralType arg ); (4) (since C++11)
1-3) Computes the hyperbolic tangent of arg
4) A set of overloads or a function template accepting an argument of any integral_type. Equivalent to 2) (the argument is cast to double).
Parameters
arg - value of a floating-point or Integral_type
Return value
If no errors occur, the hyperbolic tangent of arg (tanh(arg), or
earg
-e-arg
earg
+e-arg
) is returned.
If a range error occurs due to underflow, the correct result (after rounding) is returned.
Error handling
Errors are reported as specified in math_errhandling.
If the implementation supports IEEE floating-point arithmetic (IEC 60559),
* if the argument is ±0, ±0 is returned
* If the argument is ±∞, ±1 is returned
* if the argument is NaN, NaN is returned
Notes
POSIX_specifies that in case of underflow, arg is returned unmodified, and if that is not supported, and implementation-defined value no greater than DBL_MIN, FLT_MIN, and LDBL_MIN is returned.
Examples
// Run this code
Output:
See also
sinh
sinhf
sinhl computes hyperbolic sine (sh(x))
(C++11)
(C++11)
cosh
coshf
coshl computes hyperbolic cosine (ch(x))
(C++11)
(C++11)
atanh
atanhf
atanhl computes the inverse hyperbolic tangent (artanh(x))
(C++11)
(C++11)
(C++11)
tanh(std::complex) (function template)
tanh(std::valarray) (function template)