MathNSignTNumeric Method
Returns an integer that indicates the sign of a number.
Namespace: Jodosoft.NumericsAssembly: Jodosoft.Numerics (in Jodosoft.Numerics.dll) Version: 2.0
public static int Sign<TNumeric>(
TNumeric value
)
where TNumeric : struct, new(), INumeric<TNumeric>
Public Shared Function Sign(Of TNumeric As {Structure, New, INumeric(Of TNumeric)}) (
value As TNumeric
) As Integer
public:
generic<typename TNumeric>
where TNumeric : value class, gcnew(), INumeric<TNumeric>
static int Sign(
TNumeric value
)
static member Sign :
value : 'TNumeric -> int when 'TNumeric : struct, new() and INumeric<'TNumeric>
- value TNumeric
- A number.
- TNumeric
Int32
A number that indicates the sign of
value, as shown in the following table.
Return value | Meaning |
---|
-1 | value is less than zero |
0 | value is equal to zero. |
1 | value is greater than zero. |
This method may return
NaN or Infinity.
If
NaN or Infinity cannot be represented by
TNumeric,
then this method may throw an
ArithmeticException.