sign function

int sign(
  1. num num
)

Implementation

int sign(num num) {
  return num > 0
      ? 1
      : num < 0
          ? -1
          : 0;
}