# ABS

Absolute value of a number. This is a polymorphic function that preserves the input numeric type.

## Signature

ABS(col1)

| Argument | Type                                   | Description           |
| -------- | -------------------------------------- | --------------------- |
| `col1`   | INT, LONG, FLOAT, DOUBLE, BIG\_DECIMAL | Value to get absolute |

Returns the same type as the input argument.

## Usage Examples

```sql
select ABS(-12.1) AS value
from ignoreMe
```

| value |
| ----- |
| 12.1  |

```sql
select ABS(12.1) AS value
from ignoreMe
```

| value |
| ----- |
| 12.1  |

```sql
select ABS(-42) AS int_abs, ABS(-1000000L) AS long_abs, ABS(-3.14F) AS float_abs, ABS(-2.718) AS double_abs
from myTable
```

Returns INT, LONG, FLOAT, DOUBLE respectively (preserving input type).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pinot.apache.org/functions/math/abs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
