D
david ullua
Hi,
In Expand.c of BSD system, I met the following codes, the expression
(column & 07) if used to compare variable column and 7, if column<=7,
it returns true, else false. It use (column & 07) rather than
(column<=7), thus it brings me a question, does bit operation always
work more efficiently than math operation? How about plus without
carry? and minus without borrow?
I have searched through google web and newsgroups, haven't found any
relative topics
int column = 0;
//other codes .....
do {
putchar(' ');
column++;
} while (column & 07);
In Expand.c of BSD system, I met the following codes, the expression
(column & 07) if used to compare variable column and 7, if column<=7,
it returns true, else false. It use (column & 07) rather than
(column<=7), thus it brings me a question, does bit operation always
work more efficiently than math operation? How about plus without
carry? and minus without borrow?
I have searched through google web and newsgroups, haven't found any
relative topics
int column = 0;
//other codes .....
do {
putchar(' ');
column++;
} while (column & 07);