crocparty/sys/sys_data.c

20 lines
356 B
C
Raw Normal View History

#include "sys_data.h"
sys_i32 sys_max_i32(sys_i32 x, sys_i32 y) {
return x > y ? x : y;
}
sys_i32 sys_min_i32(sys_i32 x, sys_i32 y) {
return x < y ? x : y;
2024-02-26 06:23:43 +00:00
}
sys_i32 sys_abs_i32(sys_i32 x) {
if (x < 0) { return -x; }
return x;
}
sys_i32 sys_sgn_i32(sys_i32 x) {
if (x < 0) { return -1; }
if (x > 0) { return 1; }
return 0;
}