Well, if they're both numbers, substract them from each other and use
the result as an if expression. The if will be false if they're equal
or true if they're not. If you want to know which is bigger, ask a
higher C guru. I don't really know all that much about bit-twiddling
arithmetic.
how about this, for unsigned types only
if(!(a-b)) puts("the same");
else
{
while(a-- && b--) a--, b--;
if(a && !b) puts ("a was larger");
if(!a && b) puts ("b was larger");
}
you can probably trivially extend this to cover negative numbers by
operating on combinations of a and b together.
You could also to do something like this:
if(b-a)
{
errno = 0;
log(b-a);
if(errno) puts("b was smaller than a");
errno = 0;
log(a-b);
if(errno) puts("a was smaller than b");
}
else
puts ("a equals b")
although that assumes neither a=b nor b-a is outside the range of a
double, that you don't get an underflow in the log, and that
math_errhandling ORs with MATH_ERRNO. I'm sure some cleverness could
work round all this.