TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

C++ Math atanh() Function

C++ Math atanh() Function with tutorial for beginners and professionals with examples on isgreaterequal(), less(), islessequal(), islessgreater(), isunordered(), exp(), frexp(), ldexp(), log(), log10(), modf(), exp2(), expm1(), log1p(), log2(), logb(), scalbn(), scalbln() etc.

<< Back to CPP

C++ Math atanh()

The function computes the arc hyperbolic tangent of an angle given in radian.

Where, an arc hyperbolic tangent is the inverse operation of hyperbolic tangent.

tanh-1x =atanh(x)

Syntax

Suppose an angle given in radian is 'x':

float atanh(float x);
double atanh(double x);
long double atanh(long double x);
double atanh(integral x);

Note: The return_type can be float, double long double.

Parameter

x: The value whose arc hyperbolic tangent is to be computed.

Return value

It returns the arc hyperbolic tangent of x.

Parameter Return value
-1 Finite value
x= -1 -inf
x=1 inf
x<-1 or x>1 Not a Number(nan)

Example 1

Let's see the simple example when the value of x lies between -1 and 1.

#include 
#include
using namespace std;
int main()
{
  float x=0.5;
  std::cout << "value of x is :" <

Output:

value of x is :0.5
atanh(x) : 0.549306   

In this example, atanh(x) function computes the arc hyperbolic tangent of x and returns the value 0.54.

Example 2

Let's see the simple example when the value of x is -1.

#include 
#include
using namespace std;
int main()
{
  int x= -1;
  std::cout << "value of x is :" <

Output:

value of x is :-1
atanh(x) : -inf   

In this example, atanh(x) function computes the arc hyperbolic tangent of x and returns the value ?inf.

Example 3

Let's see the simple example when the value of x is equal to 1.

#include 
#include
using namespace std;
int main()
{
  int x=1;
  std::cout << "value of x is :" <

Output:

value of x is :1
atanh(x) : inf   

In this example, atanh(x) computes the arc hyperbolic tangent of x and returns the value inf.

Example 4

Let's see the simple example when the value of x is greater than 1.

#include 
#include
using namespace std;
int main()
{
  int x=5;
  std::cout << "value of x is :" <

Output:

value of x is :5
atanh(x) : -nan   

In this example, atanh(x) computes the arc hyperbolic tangent of x and returns the value -nan.


Next TopicC++ Math Functions




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf