# SIGN

> SIGN function in StackQL: return -1, 0 or 1 depending on whether a numeric argument is negative, zero or positive.

Source: https://stackql.io/language-spec/functions/math/sign

Returns -1 if the input value is negative, 0 if the input value is 0, and 1 is the input value is positive.  

See also:  
[[` SELECT `]](/language-spec/select) 

* * * 

## Syntax

```sql
SELECT SIGN(numeric_expression) FROM <multipartIdentifier>;
```

## Arguments

__*numeric_expression*__  
An expression of the exact numeric or approximate numeric data type category.

> If *numeric_expression* is `NULL` or is a `string` or BLOB that cannot be losslessly converted into a number, then the function will return `NULL`.

## Return Value(s)

Returns `-1`, `0` or `1`.

* * *

## Examples

### Determine the sign of a number

```sql
SELECT name, sign(strftime('%s', creationTimestamp)-strftime('%s','now')) as sign
FROM google.compute.instances 
WHERE project = 'stackql-demo' 
AND zone = 'australia-southeast1-a';
```

For more information, see [https://www.sqlite.org/lang_corefunc.html#sign](https://www.sqlite.org/lang_corefunc.html#sign)
