# sign() Function & Examples

Use the sign() arithmetic function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## sign

#### sign(x)

Try it yourself:

```calculio
sign(3.5)
sign(-4.2)
sign(0)
```

[abs](https://calcul.io/function/abs/index.md)

---

## Identify a number’s direction with sign

**sign(x)** returns -1 for a negative value, 0 for zero, and 1 for a positive value. It is useful in piecewise formulas, direction vectors, and threshold logic.

## Example

`sign(-4.2)` is -1. Pair it with [abs](https://calcul.io/function/abs/index.md) to separate magnitude from direction, or use [isPositive](https://calcul.io/function/isPositive/index.md) and [isNegative](https://calcul.io/function/isNegative/index.md) when a Boolean test is clearer.

## Caveats

Near-zero floating-point values may not be exactly zero; define a tolerance in measurement workflows. Complex numbers do not have the same simple ordering as reals. Use [compare](https://calcul.io/function/compare/index.md) for pairwise ordering of suitable values.

[All functions](https://calcul.io/functions/index.md)
