netpong/math-helpers.hpp

7 lines
97 B
C++

int signum(int num) {
int retval = 0;
(num > 0) ? retval = 1 : retval = -1;
return retval;
}