> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for SIGN function

# SIGN

Returns the sign of a numeric value: `-1` for negative values, `0` for zero, and `1` for positive values.

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
SIGN(<value>)
```

## Parameters

| Parameter | Description                       | Supported input types                                      |
| :-------- | :-------------------------------- | :--------------------------------------------------------- |
| `<value>` | The value whose sign is returned. | `DOUBLE PRECISION`, `REAL`, `INTEGER`, `BIGINT`, `NUMERIC` |

## Return Type

Same type as the input `<value>`.

## Remarks

* `SIGN(NULL)` returns `NULL`.
* `SIGN('NaN'::DOUBLE PRECISION)` returns `0`, matching PostgreSQL semantics — `NaN` is neither positive nor negative.
* `SIGN('Infinity'::DOUBLE PRECISION)` returns `1`.
* `SIGN('-Infinity'::DOUBLE PRECISION)` returns `-1`.

## Example

The following example returns the sign of several values:

<div className="query-window">
  ```
  SELECT SIGN(-42.5) AS negative, SIGN(0) AS zero, SIGN(7) AS positive;
  ```

  | negative <span>double</span> | zero <span>int</span> | positive <span>int</span> |
  | :--------------------------- | :-------------------- | :------------------------ |
  | -1                           | 0                     | 1                         |

  <p><span>Rows: 1</span><span>Execution time: 2.30ms</span></p>
</div>
