13static inline int fcmp(
double a,
double b) {
24static inline int imax(
int a,
int b) {
return a > b ? a : b; }
27static inline int imin(
int a,
int b) {
return a < b ? a : b; }
44 return memcmp(&a, &b,
sizeof(a)) == 0;
72 assert(original >= 0);
82 return (
int)(original *
scale);
static pointf scale(double c, pointf p)
static int scale_clamp(int original, double scale)
scale up or down a non-negative integer, clamping to [0, INT_MAX]
static bool is_exactly_zero(double v)
is a value precisely 0.0?
static bool is_exactly_equal(double a, double b)
are two values precisely the same?
static int imin(int a, int b)
minimum of two integers
static int fcmp(double a, double b)
comparator for doubles
static int imax(int a, int b)
maximum of two integers