#define ABS(x) ((x) >= 0 ? (x) : -(x)) #define ABSDIF(x, y) ((x) >= (y) ? (x)-(y) : (y)-(x)) #define ABSMAIOR(x, y) ((x) > (y) || (x) < -(y)) #define MAX(x, y) ((x) >= (y)? (x) : (y)) #define MIN(x, y) ((x) <= (y)? (x) : (y)) #define LIM(x, y, z) ((y) < (x) ? (x) : (y) > (z) ? (z) : (y)) #define SINAL(x) ((x) > 0 ? 1 : (x) < 0 ? -1 : 0) /* ou #define SINAL(x) (((x) > 0) - ((x) < 0)) */ #define TROCA(x, y, aux) ((aux) = (x), (x) = (y), (y) = (aux))