System.Math.Sign Method

Returns a value indicating the sign of an 8-bit signed integer.

Syntax

[System.CLSCompliant(false)]
public static int Sign (sbyte value)

Parameters

value
A signed number.

Returns

A number that indicates the sign of value, as shown in the following table.

-1

value is less than zero.

0

value is equal to zero.

1

value is greater than zero.

Remarks

This method is not CLS-compliant. For a CLS-compliant alternative, use Math.Sign(sbyte)(short).

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0