math.Expm1 Function() in Golang With Examples
Go language provides inbuilt support for basic constants and mathematical functions to perform operations on the numbers with the help of the math package. You are allowed to find base-e exponential of the specified number minus 1, i.e., e**a -1 with the help of Expm1() function provided by the math package. So, you need to add a math package in your program with the help of the import keyword to access Expm1() function.
func Expm1(a float64) float64
- If you pass +Inf in this function, then this function will return +Inf.
- If you pass -Inf in this function, then this function will return -1.
- In this function, very large values overflow to -1 or +Inf.
- If you pass NaN in this function, then this function will return NaN.
Result 1: 53.6 Result 2: -0.6 Result 3: +Inf Result 4: NaN
1479.3 + -1.0 = 1478.3