Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Calculate Hyperbolic tangent of a value in R Programming – tanh() Function

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

tanh() function in R Language is used to calculate the hyperbolic tangent of the numeric value passed to it as argument.

Syntax: tanh(x)

Parameter:
x: Numeric value

Example 1:




# R code to calculate hyperbolic tangent of a value
  
# Assigning values to variables
x1 <- -90
x2 <- -30
  
# Using tanh() Function
tanh(x1)
tanh(x2)

Output:

[1] -1
[1] -1

Example 2:




# R code to calculate hyperbolic tangent of a value
  
# Assigning values to variables
x1 <- pi
x2 <- pi / 3
  
# Using tanh() Function
tanh(x1)
tanh(x2)

Output:

[1] 0.9962721
[1] 0.7807144
My Personal Notes arrow_drop_up
Last Updated : 01 Jun, 2020
Like Article
Save Article
Similar Reads