# GoLang – Hypot() Function – Examples & Explanation

`Hypot()` function is used to find the `Sqrt(p*p + q*q) `, taking care to avoid unnecessary overflow and underflow. The standard math package of Go programming language has `Hypot()` function.

## Syntax of `Hypot()` Function in Go Programming

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

```func Hypot(p, q float64) float64
```

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

## Parameters of `Hypot()` Function in Go Programming

`x ` – Where `p , q` is any Valid `float64` Input value. These parameters are required.

## Error Handling

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

## Return Value of `Hypot()` Function in Go

`Hypot()` function will return `Sqrt(p*p + q*q) `, taking care to avoid unnecessary overflow and underflow.

## GoLang `Hypot()` Function Example 1

```package main

import "fmt"
import "math"

func main() {
var x float64
x = math.Hypot(-3, 7)
fmt.Println(x)
}
```

Output:
` 7.615773105863909`

## GoLang `Hypot()` Function Example 2

```package main

import "fmt"
import "math"

func main() {
var x float64
x = math.Hypot(2, 11)
fmt.Println(x)
}
```

Output:
` 11.180339887498947`

## GoLang `Hypot() ` Function Example 3

```package main

import "fmt"
import "math"

func main() {
var x float64
x = math.Hypot(3, 76)
fmt.Println(x)
}
```

Output:
`76.05918747922568`