/ Published in: C
Expand |
Embed | Plain Text
/***** MATH *****/ /* #define MIN(a, b) (((a) < (b)) ? (a) : (b)) */ #define MIN(a,b) (((a) < (b)) ? (a) : (b)) /* Calculates the maximum of a and b. */ #define MAX(a, b) (((a) > (b)) ? (a) : (b)) /* Calculates the absolute value of a. */ #define ABS(a) (((a) < 0) ? -(a) : (a)) /* Ensures that x is between the limits set by low and high. If low is greater than high the result is undefined.*/ #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
You need to login to post a comment.
