C - Need to compare n
lowest bits of an int for equality.
I.e. n = 4;
xxxx1001 == xxxx1001 (x is don't care)
I.e. n = 2; xxxxxx01 == xxxxxx01
Can't think of a nice way to do it without using masks, =).
C - Need to compare n
lowest bits of an int for equality.
I.e. n = 4;
xxxx1001 == xxxx1001 (x is don't care)
I.e. n = 2; xxxxxx01 == xxxxxx01
Can't think of a nice way to do it without using masks, =).
you could use the modulo operator. For example n = 4 and you have to ints x and y:
Hope this helps you.
Nick