diff options
| author | steven-na <noreply.github@stvnc.dev> | 2026-07-31 20:40:58 -0700 |
|---|---|---|
| committer | steven-na <noreply.github@stvnc.dev> | 2026-07-31 20:40:58 -0700 |
| commit | 75d360d5c94f70bc93dfd2a52faee374a8e5838b (patch) | |
| tree | 77918ffc84374cfafbcc949131d2197c401aef64 /src/common.h | |
| parent | 9b0b3d9d19f5adbf73423f9146974bf9213624d5 (diff) | |
Vec2d impls
Diffstat (limited to 'src/common.h')
| -rw-r--r-- | src/common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h index 1add4db..ad7a288 100644 --- a/src/common.h +++ b/src/common.h @@ -2,11 +2,16 @@ #include <stdint.h> #include <stddef.h> +#include <math.h> // IWYU pragma: keep #define KiB(n) ((u64)n<<10) #define MiB(n) ((u64)n<<20) #define GiB(n) ((u64)n<<30) +#define PI 3.14159265358979323846264338327950 +#define F64_EPSILON = 1e-9 + +#define F64_EQ(x, y, eps) (fabs((x) - (y)) <= (eps)) #define MAX(n, m) ((n > m) ? (n) : (m)) #define MIN(n, m) ((n < m) ? (n) : (m)) #define ALIGN_UP_POW2(n, m) (((u64)(n) + (u64)(m) - 1) & (~((u64)(m) - 1))) |