diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-28 16:22:49 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-28 16:22:49 -0500 |
commit | 238f3ecc526600d5c18fead7820469719027b07c (patch) | |
tree | d84cd6606be4a81e32f8f0634aeb924b0457e5f8 /math.c | |
parent | 5b90057859cd38b284573460460ab27bd108aa0e (diff) |
got file selector to behave better
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -112,6 +112,16 @@ static i64 mod_i64(i64 a, i64 b) { return ret; } +static i64 abs_i64(i64 x) { + return x < 0 ? -x : +x; +} + +static i64 sgn_i64(i64 x) { + if (x < 0) return -1; + if (x > 0) return +1; + return 0; +} + static float sgnf(float x) { if (x < 0) return -1; if (x > 0) return +1; |