Asinh()

Published Sep 6, 2023
Contribute to Docs

The Asinh() function returns the inverse hyperbolic sine of a number.

Syntax

result := math.Asinh(number)

The Asinh() function takes one parameter, number, a type of float64. It returns a number representing the inverse hyperbolic sine (also known as arcsinh) value of number as a type of float64. If the value of number is:

  • Not defined (undefined), then it returns NaN (Not a Number)
  • Positive infinity or equivalent, then it returns +Inf
  • Negative infinity or equivalent, then it returns -Inf

Note: The math library must be imported first to use this function.

Example

The following example first calculates the inverse hyperbolic sine of num and then prints out the result to the console:

package main
import (
"fmt"
"math"
)
func main() {
num := 16.1
inverseHyperbolicSine := math.Asinh(num)
fmt.Printf("The inverse hyperbolic sine of %f is %f\n", num, inverseHyperbolicSine)
}

The output will be:

The inverse hyperbolic sine of 16.100000 is 3.472930

Codebyte Example

The following example is runnable and uses the Asinh() function with two values: negative infinity and 3.1.

us
Visit us
code
Hide code
Code
Output
Hide output
Hide output
Loading...

All contributors

Looking to contribute?

Learn Go on Codecademy