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 complementary error function of the specified number with the help of the Erfc() 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 Erfc() function.
func Erfc(a float64) float64
- If you pass +Inf in this function, then this function will return 0.
- If you pass -Inf in this function, then this function will return 2.
- If you pass NaN in this function, then this function will return NaN.
Result 1: 0.0 Result 2: 2.0 Result 3: 0.0 Result 4: NaN
2.0 + 0.0 = 2.0