damn_T_T's blog

By damn_T_T, history, 7 years ago, In English

Here line 12 and 14 should output the same value (expected output 1)

But why when I call range(i,mn,mx) it outputs 0?

  • Vote: I like it
  • -14
  • Vote: I do not like it

»
7 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

you should write

#define range(i,mn,mx) (((i) >= mn) && ((i) <= mx)?1:0)

instead of

#define range(i,mn,mx) ((i >= mn) && (i <= mx)?1:0)