Trusted answers to developer questions

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

In C++, the `atanh()`

**function** is used to return the arc hyperbolic tangent in radians of a number argument that is passed to it.

Note: The arc hyperbolic tangent is also referred to as the

inverse hyperbolic tangent.

$atanh(x)=tanh^{-1}x$

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

: The`x`

`atanh()`

function takes a single argument,`x`

, as the only and mandatory parameter value.

The `atanh()`

function returns the arc hyperbolic tangent of the argument `x`

that is passed to it.

Argument(`x` ) |
Return value |
---|---|

x = 1 | infinite value (∞) |

x = -1 | negative infinite value (-∞) |

x < -1 or x > 1 | NaN value |

-1 < x < 1 | finite value |

#include <iostream> #include <cmath> using namespace std; int main() { // creating variables int x =1 ; double result; // immplementing the atanh() function result = atanh(x); cout << "atanh(10) = " << result << " radian" << endl; return 0; }

Implementing the "atanh()" function.

- Line 10: We create the variables
`x`

and`result`

. - Line 14: We implement the
`atanh()`

function on the value of the`x`

variable and assign the output to the`result`

variable. - Line 15: We print the
`result`

variable.

RELATED TAGS

functions

c++

communitycreator

CONTRIBUTOR

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Keep Exploring

Related Courses