Example 1
- x = 5
1
What is the sign of 5? 1. Positives give one.
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|.
Enter data and click Calculate.
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.
sgn(x) = x>0 ? 1 : x<0 ? −1 : 0
Signum returns the sign: 1, −1 or 0. 5 gives 1. −3 gives −1. 0 gives 0. This is not |x|.
1
What is the sign of 5? 1. Positives give one.
-1
What is the sign of −3? −1. Negatives give minus one, not −3.
0
What is the sign of 0? 0. Zero is neither plus nor minus.
1. Every x > 0 gives 1, including 0.1.
The sign function: 1, −1 or 0. Written sgn(x). This is not absolute value.
−1. The size of three disappears. Only the minus stays, as −1.
0. The formula returns 0 when x is neither larger nor smaller than zero.
|−3| = 3. sgn(−3) = −1. One drops the sign, the other drops the size.
Yes. 0.1 > 0, so the ternary returns 1.
No. It computes x>0?1:x<0?−1:0. A typed 0 still gives 0.
On the |x| card. Here you stay with the sign alone.
The formula does not split −0. Zero from the field gives 0.
Yes. −3.5 is smaller than zero, so the result is −1.
The calculator computes the same formula as the definition below.
Page updated in 2026.