Which is the most efficient way in C to check that at least one of two
integer is zero?
I've got a code that is doing a lot of these operation. I was wondering
what is the most efficient one to use. Is it likely that the compiler will
correct it if I intentionally choose the "wrongest"?
int a, b;
//Assign a value to a and b
//The wrongest?
if (a * b == 0)
//The best?
if (a & b == 0)
//The most obvious?
if (a == 0 || b == 0)
Other ideas?
No comments:
Post a Comment