Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 734 Bytes

101_tanh.asciidoc

File metadata and controls

44 lines (29 loc) · 734 Bytes

tanh

NAME

tanh - hyperbolic tangent function.

SYNOPSIS
#include <math.h>

double tanh(double x);
DESCRIPTION

The tanh() function returns the hyperbolic tangent of x, which is defined mathematically as sinh(x) / cosh(x).

Warning
You’ll also need to link the program against the math library (see example below) using the -lm compile/link option.
SEE ALSO

cosh, sinh

EXAMPLE
link:src/tan.c[role=include]
OUTPUT
$ gcc -Wall -lm tanh.c
$ ./a.out
Hyperbolic tangent of 45.000000 degrees is 0.655794