mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
util: abs
This commit is contained in:
@@ -4,4 +4,8 @@
|
||||
#define ROUND_DOWN(v, n) ((v) - ((v) % (n)))
|
||||
#define ROUND_UP(v, n) ROUND_DOWN((v) + (n) - 1, n)
|
||||
|
||||
static inline long abs(long x) {
|
||||
return x < 0 ? -x : x;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user