Sign of a number (signum)

Type an x. Signum returns only the sign: 1, −1 or 0. 5 gives 1. −3 gives −1. 0 gives 0. The size of the number does not enter the result.

The calculator computes x>0 ? 1 : x<0 ? −1 : 0. Zero stays zero, not one. This is not |x|.

Input data

Results

Enter data and click Calculate.

How it works

The sign of a number (signum) asks which side of zero x sits on. Positives give 1. Negatives give −1. Zero gives 0. 5 is on the plus side, so the result is 1. The size of five disappears.

−3 is on the minus side, so the result is −1, not −3. The calculator does not call Math.sign with a special rule for −0. The formula is a plain ternary: x>0?1:x<0?−1:0.

The field is x. A comma works. 0.1 gives 1, because it is larger than zero. −0.1 gives −1. Bare zero gives 0. That is the only 0 in this calculator: x really is zero.

Absolute value drops the sign and keeps the size: |−3| = 3. Here the sign stays and the size dies. Floor of −3 is −3, not −1.

Notebooks write sgn(x) or sign(x). The relation |x| = x · sgn(x) when x ≠ 0. This calculator computes only the sign side.

5 gives 1. −3 gives −1. 0 gives 0.

Formula

sgn(x) = x>0 ? 1 : x<0 ? −1 : 0

How to use

  1. Type x, for example 5.
  2. Click Calculate. Signum gives 1.
  3. −3 gives −1. 0 gives 0.
  4. The size does not come back. −3 will not give 3.
  5. Absolute value lives on the neighbouring card.

5 gives 1, −3 gives −1

Signum returns the sign: 1, −1 or 0. 5 gives 1. −3 gives −1. 0 gives 0. This is not |x|.

signum
The sign function on the page. 5 gives 1. −3 gives −1. 0 gives 0.
sign
The side of the axis: plus, minus or zero. The size of the number does not come back.
zero
The only input whose result is 0. 0.1 already gives 1. −0.1 gives −1.

Examples

Example 1

  • x = 5

1

What is the sign of 5? 1. Positives give one.

Example 2

  • x = -3

-1

What is the sign of −3? −1. Negatives give minus one, not −3.

Example 3

  • x = 0

0

What is the sign of 0? 0. Zero is neither plus nor minus.

Related calculators

Common questions

What is the sign of 5?

1. Every x > 0 gives 1, including 0.1.

What does signum mean?

The sign function: 1, −1 or 0. Written sgn(x). This is not absolute value.

What is the sign of −3?

−1. The size of three disappears. Only the minus stays, as −1.

What is the sign of 0?

0. The formula returns 0 when x is neither larger nor smaller than zero.

How is signum different from |x|?

|−3| = 3. sgn(−3) = −1. One drops the sign, the other drops the size.

Does 0.1 give 1?

Yes. 0.1 > 0, so the ternary returns 1.

Does the calculator call Math.sign?

No. It computes x>0?1:x<0?−1:0. A typed 0 still gives 0.

Where is absolute value?

On the |x| card. Here you stay with the sign alone.

Is negative zero special?

The formula does not split −0. Zero from the field gives 0.

Does a comma in −3.5 work?

Yes. −3.5 is smaller than zero, so the result is −1.

Knowledge sources

The calculator computes the same formula as the definition below.

Page updated in 2026.