#include
#define GREAT_THAN(a, b) ((a) > (b))
#define LESS_THAN(a, b) ((a) < (b))
#define GREAT_OR_EQUAL(a, b) ((a) >= (b))
#define LESS_OR_EQUAL(a, b) ((a) <= (b))
#define NOT_EQUAL(a, b) ((a) != (b))
#define EQUAL_TO(a, b) ((a) == (b))
static int test(void)
{
int x;
int y;
printf("> operation:\n");
for (x = 0; x < 2; x++) {
for (y = 0; y < 2; y++) {
printf("%x > %x --> %x\n", x, y, GREAT_THAN(x, y));
}
}
printf("\n< operation:\n");
for (x = 0; x < 2; x++) {
for (y = 0; y < 2; y++) {
printf("%x < %x --> %x\n", x, y, LESS_THAN(x, y));
}
}
printf("\n>= operation:\n");
for (x = 0; x < 2; x++) {
for (y = 0; y < 2; y++) {
printf("%x >= %x --> %x\n", x, y, GREAT_OR_EQUAL(x, y));
}
}
printf("\n<= operation:\n");
for (x = 0; x < 2; x++) {
for (y = 0; y < 2; y++) {
printf("%x <= %x --> %x\n", x, y, LESS_OR_EQUAL(x, y));
}
}
printf("\n!= operation:\n");
for (x = 0; x < 2; x++) {
for (y = 0; y < 2; y++) {
printf("%x != %x --> %x\n", x, y, NOT_EQUAL(x, y));
}
}
printf("\n== operation:\n");
for (x = 0; x < 2; x++) {
for (y = 0; y < 2; y++) {
printf("%x == %x --> %x\n", x, y, EQUAL_TO(x, y));
}
}
return 0;
}
int main(void)
{
test();
return 0;
}