GoLang – Find Inverse of Sine – Asin() Function – Examples & Explanation

Asin() function is used to find the inverse of a sine in Go language. The inverse of a sine is also known as arcsine.

Asin() Function in Go Language

math.Asin() exists is Standard math Library of Go Programming Language. The purpose of this function is to calculate arcsine or the inverse of the sin of any given number (x – parameter) within the range of -1 and 1.


Asin() Function Syntax in Go Language

The syntax of Asin() function in GoLang is

Note: float64 is a data type in go language which has IEEE-754 64-bit floating-point numbers.
Special cases are:
Asin(±0) = ±0
Asin(x) = NaN if x < -1 or x > 1


GoLang Asin() Function Parameters

x – Any valid Golang number (positive or negative within the range of -1 and 1). This parameter is required.
Note: If the x parameter is not a number or greater than 1, Asin() function will return an error.


GoLang Asin() Function Return Value

Asin() function will return a floating point number (a value of the inverse of sine in radians).


GoLang Asin() Function Example 1



GoLang Asin() Function Example 2



GoLang Asin() Function Example 3


Note: The unit of output is radian.