Does a function exist in the standard library to compute the sign of an
integer? Example:
int sign(int v)
{
return v > 0 ? 1 : (v < 0 ? -1 : 0);
}
Thanks.
integer? Example:
int sign(int v)
{
return v > 0 ? 1 : (v < 0 ? -1 : 0);
}
Thanks.
Comment