Warning 6281 - incorrect order of operations : relational operators have higher precedence than bitwise operators 警告6281 -運(yùn)算順序不正確:關(guān)系運(yùn)算符的優(yōu)先級(jí)高于位運(yùn)算符
The bitwise operators allow you to manipulate individual bits in an integral primitive data type 按位運(yùn)算符允許我們操作一個(gè)整數(shù)主數(shù)據(jù)類型中的單個(gè)“比特” ,即二進(jìn)制位。
For booleans the bitwise operators have the same effect as the logical operators except that they do not short circuit 對(duì)于布爾值,按位運(yùn)算符具有與邏輯運(yùn)算符相同的效果,只是它們不會(huì)中途“短路” 。
Of course , with the shift and bitwise operators distributed around the table it is not a perfect mnemonic , but for non - bit operations it works 當(dāng)然,對(duì)于移位和按位運(yùn)算符,上表并不是完美的助記方法;但對(duì)于其他運(yùn)算來說,它確實(shí)很管用。
The logical and bitwise operators have the order of precedence described below , and all have lower precedence than the arithmetic , concatenation , and comparison operators 邏輯運(yùn)算符和位運(yùn)算符具有下述優(yōu)先順序,它們的優(yōu)先級(jí)均低于算術(shù)運(yùn)算符、串聯(lián)運(yùn)算符和比較運(yùn)算符。
The arithmetic and concatenation operators have the order of precedence described below , and all have higher precedence than the comparison , logical , and bitwise operators 算術(shù)運(yùn)算符和串聯(lián)運(yùn)算符具有下述優(yōu)先級(jí)順序,它們的優(yōu)先級(jí)均高于比較運(yùn)算符、邏輯運(yùn)算符和位運(yùn)算符。
All comparison operators have equal precedence , and all have higher precedence than the logical and bitwise operators , but lower precedence than the arithmetic and concatenation operators 比較運(yùn)算符具有相同的優(yōu)先級(jí),它們的優(yōu)先級(jí)均高于邏輯運(yùn)算符和位運(yùn)算符,但低于算術(shù)運(yùn)算符和串聯(lián)運(yùn)算符。
Since the logical and bitwise operators have a lower precedence than other arithmetic and relational operators , any bitwise operations should be enclosed in parentheses to ensure accurate execution 因?yàn)檫壿嫼桶次贿\(yùn)算符的優(yōu)先級(jí)低于其他算術(shù)和關(guān)系運(yùn)算符,所以應(yīng)將所有按位運(yùn)算括在括號(hào)中以確保準(zhǔn)確的執(zhí)行。
Since the logical and bitwise operators have a lower precedence than other arithmetic and relational operators , any bitwise operations should be enclosed in parentheses to ensure accurate results 因?yàn)檫壿嫼桶次贿\(yùn)算符的優(yōu)先級(jí)低于其他算術(shù)和關(guān)系運(yùn)算符,所以應(yīng)將所有按位運(yùn)算括在括號(hào)中以確保準(zhǔn)確的計(jì)算結(jié)果。
Bitwise operators can be combined with the = sign to unite the operation and assignment : & = , | = and ^ = are all legitimate . ( since ~ is a unary operator it cannot be combined with the = sign 按位運(yùn)算符可與等號(hào)( = )聯(lián)合使用,以便合并運(yùn)算及賦值: & = , | =和^ =都是合法的(由于~是一元運(yùn)算符,所以不可與=聯(lián)合使用) 。