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 the error function of the specified number with the help of Erf() 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 the Erf() function.
func Erf(a float64) float64
- If you pass +Inf in this function, then this function will return 1.
- If you pass -Inf in this function, then this function will return -1.
- If you pass NaN in this function, then this function will return NaN.
Result 1: 0.8 Result 2: -1.0 Result 3: 1.0 Result 4: NaN
0.8 + 1.0 = 1.8
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.