# negate

Returns the negation of the input value. This is a polymorphic function that preserves the input numeric type.

`negate(col)` is equivalent to the unary minus operator `-col`. See [Arithmetic Operators](/build-with-pinot/querying-and-sql/sql-syntax/sql-reference.md#arithmetic-operators) for operator syntax.

## Signature

negate(col)

| Argument | Type                                   | Description     |
| -------- | -------------------------------------- | --------------- |
| `col`    | INT, LONG, FLOAT, DOUBLE, BIG\_DECIMAL | Value to negate |

Returns the same type as the input argument.

## Usage Examples

```sql
SELECT negate(42.5) AS value
FROM myTable
```

| value |
| ----- |
| -42.5 |

```sql
SELECT negate(-10) AS value
FROM myTable
```

| value |
| ----- |
| 10    |

```sql
SELECT negate(100) AS int_neg, negate(1000000L) AS long_neg, negate(3.14F) AS float_neg, negate(2.718) AS double_neg
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/negate.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.
