GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::tanh,std::tanhf,std::tanhl(3) C++ Standard Libary std::tanh,std::tanhf,std::tanhl(3)

std::tanh,std::tanhf,std::tanhl - std::tanh,std::tanhf,std::tanhl


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).


arg - value of a floating-point or Integral type


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.


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


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.

// Run this code


#include <iostream>
#include <cmath>


int main()
{
std::cout << std::showpos
<< "tanh(+1) = " << std::tanh(+1) << '\n'
<< "tanh(-1) = " << std::tanh(-1) << '\n'
<< "tanh(0.1)*sinh(0.2)-cosh(0.2) = "
<< std::tanh(0.1) * std::sinh(0.2) - std::cosh(0.2) << '\n'
// special values:
<< "tanh(+0) = " << std::tanh(+0.0) << '\n'
<< "tanh(-0) = " << std::tanh(-0.0) << '\n';
}


tanh(+1) = +0.761594
tanh(-1) = -0.761594
tanh(0.1)*sinh(0.2)-cosh(0.2) = -1
tanh(+0) = +0
tanh(-0) = -0


sinh
sinhf computes hyperbolic sine (\({\small\sinh{x} }\)sinh(x))
sinhl (function)
(C++11)
(C++11)
cosh
coshf computes hyperbolic cosine (\({\small\cosh{x} }\)cosh(x))
coshl (function)
(C++11)
(C++11)
atanh
atanhf computes the inverse hyperbolic tangent
atanhl (\({\small\operatorname{artanh}{x} }\)artanh(x))
(C++11) (function)
(C++11)
(C++11)
computes hyperbolic tangent of a complex number
tanh(std::complex) (\({\small\tanh{z} }\)tanh(z))
(function template)
tanh(std::valarray) applies the function std::tanh to each element of valarray
(function template)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.