# GoLang – Find Error Function – Erf() Function – Examples & Explanation

`Erf()` function is used to find the error function of the given input (`x` – parameter) in Go language. The standard math package of Go programming language has `Erf()` function. The purpose of this function is to find the error function.

## Syntax of `Erf()` Function in Go Language

The syntax of `Erf()` function in Go Language is:

```func Erf(x float64) float64
```

Note: `float64` is a data type in Go language which has IEEE-754 64-bit floating-point numbers.
Special cases are:
```Erf(+Inf) = 1 Erf(-Inf) = -1 Erf(NaN) = NaN```

## Parameters of `Erf()` Function in Go Language

`x ` – Where `x` is any Valid `float64` Input value. This parameter is required.

## Error Handling

If the `x ` parameter is not a number (numeric value) `Erf()` function returns an `error `.
If there is no argument (`x` – input value) passes to the function, then the compiler will produce an `error`.

## Return Value of `Erf()` Function in Go Language

`Erf()` function will return the error function of the given input(`x ` – parameters).

## GoLang `Erf()` Function Example 1

```package main

import "fmt"
import "math"

func main() {
var x float64
x = math.Erf(-8)
fmt.Println(x)
}
```

Output:
` -1`

## GoLang `Erf()` Function Example 2

```package main

import "fmt"
import "math"

func main() {
var x float64
x = math.Erf(1.968)
fmt.Println(x)
}
```

Output:
` 0.9946169787747117`

## GoLang `Erf() ` Function Example 3

```package main

import "fmt"
import "math"

func main() {
var x float64
x = math.Erf(0)
fmt.Println(x)
}
```

Output:
`0`