20 lines
356 B
C
20 lines
356 B
C
#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;
|
|
}
|
|
|
|
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;
|
|
} |