How do you transform a number to its sign? [closed]

Why not just do this

int sign = i<=0 ? -1 : 1;

Leave a Comment