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

# SIGN

> Returns the sign of a number or interval.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

**Aliases:** [`signum`](/query/sql/functions/math/signum)

Returns NULL for a NULL numeric or interval input. Both positive and negative numeric zero produce 0.0; numeric NaN remains NaN.

## Syntax

### Numeric or interval

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
sign(value)
```

## Arguments

### Numeric

| Name | Type | Required | Description |
| - | - | - | - |
| value | TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE or DECIMAL(p, s) | Yes | The numeric value whose sign is returned. For DECIMAL(p, s), p is precision (total digits) and s is scale (digits after the decimal point). |

### Interval

| Name | Type | Required | Description |
| - | - | - | - |
| value | INTERVAL | Yes | The year-month, day-time or month-day-nanosecond interval whose sign is returned. |

## Returns

* Type: DOUBLE
* Possible values: -1.0 for negative values, 0.0 for zero and 1.0 for positive values; numeric NaN remains NaN.
* NULL behavior: Returns NULL for a NULL numeric or interval input. Both positive and negative numeric zero produce 0.0; numeric NaN remains NaN.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Usage notes

* Numeric input is cast to DOUBLE before taking its sign.
* For year-month intervals the sign follows the month count. For day-time intervals it follows days plus milliseconds. For month-day-nanosecond intervals, a nonzero month component determines the sign; otherwise days plus nanoseconds determine it.
* INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.

## Examples

### Value and NULL input

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT sign(-5) AS negative, sign(0) AS zero, sign(5) AS positive, sign(CAST(NULL AS INT)) AS null_value;
```

| negative | zero | positive | null\_value |
| - | - | - | - |
| -1 | 0 | 1 | NULL |

### Interval sign and NULL

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT sign(INTERVAL '1' DAY) AS positive, sign(INTERVAL '-1' DAY) AS negative;
```

| positive | negative |
| - | - |
| 1 | -1 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.