MathNSignTNumeric Method

Returns an integer that indicates the sign of a number.

Definition

Namespace: Jodosoft.Numerics
Assembly: Jodosoft.Numerics (in Jodosoft.Numerics.dll) Version: 2.0
public static int Sign<TNumeric>(
	TNumeric value
)
where TNumeric : struct, new(), INumeric<TNumeric>

Parameters

value  TNumeric
A number.

Type Parameters

TNumeric

Return Value

Int32
A number that indicates the sign of value, as shown in the following table.
Return valueMeaning
-1value is less than zero
0value is equal to zero.
1value is greater than zero.

Remarks

This method may return NaN or Infinity. If NaN or Infinity cannot be represented by TNumeric, then this method may throw an ArithmeticException.

Exceptions

ArithmeticExceptionvalue is equal to NaN.

See Also