Sign()

Math::Sign(T) method

Determines the sign of the specified signed integral value.

template<typename T> static std::enable_if<std::is_integral<T>::value &&!std::is_unsigned<T>::value, int>::type System::Math::Sign(T value)

Template parameters

ParameterDescription
TThe integral signed type

Arguments

ParameterTypeDescription
valueTThe value to determine the sign of

Return Value

-1 if value is less than 0; 0 if value is equal to 0; 1 if value is greater than 0

Math::Sign(T) method

Determines the sign of the specified floating-point value.

template<typename T> static std::enable_if<std::is_floating_point<T>::value, int>::type System::Math::Sign(T value)

Template parameters

ParameterDescription
TThe floating point type of the argument

Arguments

ParameterTypeDescription
valueTThe value to determine the sign of

Return Value

-1 if value is less than 0; 0 if value is equal to 0; 1 if value is greater than 0

Math::Sign(const Decimal&) method

Determines the sign of the specified decimal value.

static int System::Math::Sign(const Decimal &value)

Arguments

ParameterTypeDescription
valueconst Decimal&The value to determine the sign of

Return Value

-1 if value is less than 0; 0 if value is equal to 0; 1 if value is greater than 0

See Also