---
title: "sign function in Strata | Oplema"
description: "Get the sign of a number as -1, 0 or 1, so you can tell negative values from positive ones. For example, sign(-349) returns -1."
url: "https://oplema.com/docs/strata/functions/sign"
updated: "2026-11-04"
---

# sign

Return -1 for a negative number, 0 for zero and 1 for a positive number.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **BIGINT**.

### Expression

```
sign(-349)
```

### Result

```
-1
```

The expression returns `TINYINT`. Formula stores it as `BIGINT` in this example. To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | \-1 |

## Arguments and types

```
sign(x)
```

**x**

Number

Supported signatures (12)

```
sign(x: BIGINT) → TINYINT
sign(x: DOUBLE) → TINYINT
sign(x: FLOAT) → TINYINT
sign(x: HUGEINT) → TINYINT
sign(x: INTEGER) → TINYINT
sign(x: SMALLINT) → TINYINT
sign(x: TINYINT) → TINYINT
sign(x: UBIGINT) → TINYINT
sign(x: UHUGEINT) → TINYINT
sign(x: UINTEGER) → TINYINT
sign(x: USMALLINT) → TINYINT
sign(x: UTINYINT) → TINYINT
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[bit\_count

Returns the number of bits that are set.

](https://oplema.com/docs/strata/functions/bit-count)[cbrt

Calculate the cube root of a number.

](https://oplema.com/docs/strata/functions/cbrt)[isfinite

Check whether a value is finite, meaning neither infinite nor NaN.

](https://oplema.com/docs/strata/functions/isfinite)[isinf

Check whether a value is infinite.

](https://oplema.com/docs/strata/functions/isinf)

[Browse numbers](https://oplema.com/docs/strata/functions#numbers) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/numeric.html#signx)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
