# tanh(), tanhf(), tanhl()

Calculate the hyperbolic tangent

## Synopsis:

```#include <math.h>

double tanh( double x );

float tanhf( float x );

long double tanhl( long double x );
```

## Arguments:

x
The angle, in radians, for which you want to compute the hyperbolic tangent.

## Library:

libm

Use the -l m option to qcc to link against this library.

## Description:

These functions compute the hyperbolic tangent (specified in radians) of x.

When the x argument is large, partial or total loss of significance may occur.

## Returns:

The hyperbolic tangent value.

If an error occurs, these functions return 0, but this is also a valid mathematical result. If you want to check for errors, set errno to 0, call the function, and then check errno again. These functions don't change errno if no errors occurred.

## Examples:

```#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main( void )
{
printf( "%f\n", tanh(.5) );
return EXIT_SUCCESS;
}
```

produces the output:

```0.462117
```

## Classification:

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
{"ft_lang_label":"__label__en","ft_lang_prob":0.56306493,"math_prob":0.50029594,"size":1060,"snap":"2021-31-2021-39","text_gpt3_token_len":269,"char_repetition_ratio":0.11079545,"word_repetition_ratio":0.0,"special_character_ratio":0.25377357,"punctuation_ratio":0.18932039,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9909313,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-24T09:52:36Z\",\"WARC-Record-ID\":\"<urn:uuid:da3d8512-0d77-4ef9-9c97-d0536d9089b7>\",\"Content-Length\":\"35999\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9952a3b9-3171-412f-8fe5-f9ecacc3e17c>\",\"WARC-Concurrent-To\":\"<urn:uuid:5d709ff1-45ae-4e12-a9c5-58b22ad7ac1b>\",\"WARC-IP-Address\":\"74.82.70.131\",\"WARC-Target-URI\":\"https://developer.blackberry.com/playbook/native/reference/com.qnx.doc.neutrino.lib_ref/topic/t/tanh.html\",\"WARC-Payload-Digest\":\"sha1:SEZJZOYATAMKHTIXX5DLL7R7Z2GEKKXF\",\"WARC-Block-Digest\":\"sha1:WSAZDOWG6EBWSBNHYQVASVZCG7B7VBHO\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780057508.83_warc_CC-MAIN-20210924080328-20210924110328-00610.warc.gz\"}"}