precedence lossage

precedence lossage

/pre's*-dens los'*j/ A misunderstanding of operator precedence resulting in unintended grouping of arithmetic orlogical operators when coding an expression. Usedespecially of mistakes in C code due to the nonintuitivelylow precedence of "&", "|", "^", "<>". For example,the following C expression, intended to test the leastsignificant bit of x,

x & 1 == 0

is parsed as

x & (1 == 0)

which is always zero (false).

Some lazy programmers ignore precedence and parenthesiseeverything. Lisp fans enjoy pointing out that this can'thappen in *their* favourite language, which eschews precedenceentirely, requiring one to use explicit parentheseseverywhere.