﻿---
title: ES|QL HYPOT function
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/3002/reference/query-languages/esql/functions-operators/math-functions/hypot
products:
  - Elasticsearch
---

# ES|QL HYPOT function
## Syntax

![Embedded](https://www.elastic.co/elastic/docs-builder/docs/3002/reference/query-languages/esql/images/functions/hypot.svg)


## Parameters

<definitions>
  <definition term="number1">
    Numeric expression. If `null`, the function returns `null`.
  </definition>
  <definition term="number2">
    Numeric expression. If `null`, the function returns `null`.
  </definition>
</definitions>


## Description

Returns the hypotenuse of two numbers. The input can be any numeric values, the return value is always a double. Hypotenuses of infinities are null.

## Supported types


| number1       | number2       | result |
|---------------|---------------|--------|
| double        | double        | double |
| double        | integer       | double |
| double        | long          | double |
| double        | unsigned_long | double |
| integer       | double        | double |
| integer       | integer       | double |
| integer       | long          | double |
| integer       | unsigned_long | double |
| long          | double        | double |
| long          | integer       | double |
| long          | long          | double |
| long          | unsigned_long | double |
| unsigned_long | double        | double |
| unsigned_long | integer       | double |
| unsigned_long | long          | double |
| unsigned_long | unsigned_long | double |


## Example

```esql
ROW a = 3.0, b = 4.0
| EVAL c = HYPOT(a, b)
```


| a:double | b:double | c:double |
|----------|----------|----------|
| 3.0      | 4.0      | 5.0      |