Very, very important, due to the fact that #define is really just preprocessed substitution.
Examine the following clearly wrong code:
#include <stdio.h>
#define HALF(X) X/2
int main() {
printf( "Half of 4 is %d\n", HALF(4+0) );
return 0;
}
Run it. It'll try to convince you that half of four is four! This is because the code is preprocessed as this:
/* contents of stdio.h here */
int main() {
printf( "Half of 4 is %d\n", 4+0/2 );
return 0;
}
See? You need the parenthesis; the proper macro is:
#define HALF(X) ((X)/2)
This will give you the (4+0)/2 you need. Also note surrounding parenthesis, which allows one to safely multiply by its value.